Results 1 to 6 of 6

Thread: Listview

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Norway
    Posts
    11

    Post

    How can i use the Lisview control in my project ?

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176

    Post

    Like this:
    Code:
    Private Sub Form_Load()
        Dim iIndex As Integer
        Dim oListItem As ListItem
        
        With ListView1
            .View = lvwReport
            .FullRowSelect = True
            .ColumnHeaders.Add , , "Column1"
            .ColumnHeaders.Add , , "Column2"
            .ColumnHeaders.Add , , "Column3"
            For iIndex = 1 To 10
                Set oListItem = .ListItems.Add(, , "Item" & iIndex)
                oListItem.ListSubItems.Add , , iIndex & " - Part2"
                oListItem.ListSubItems.Add , , iIndex & " - Part3"
            Next
        End With
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    aarony@redwingsoftware.com
    ajyoung@pressenter.com


  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Norway
    Posts
    11

    Post

    Well Aaron, there seems to be a problem. I cant declare a Listview. It cant find anything called Listview when i
    Dim oListview as Listview. no listview comes up as an option.

    isnt it possible to get it up as a icon, likse the listbox and the combobox ?

    what to do ? frustrated...

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Select Components from the Project menu. Then select Microsoft Windows Common Controls X (where x is the latest version you have installed) from the list. Click OK.

    Add a ListView control from the ToolBox to your form.....thats all.

    ------------------

    Serge

    Programmer Analyst
    sdymkov@microage.com
    Access8484@aol.com
    ICQ#: 51055819


  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Norway
    Posts
    11

    Post

    Well. I have got the listview working. That was nice!

    But, is there a way to clear the listview ? Couldnt seem to find a listview.clear

    ANy ideas ?

  6. #6
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    I rekon these listview questions are asked every day

    ListView1.ListItems.Clear

    ------------------
    Mark Sreeves
    Analyst Programmer

    Mark.Sreeves@Softlab.co.uk
    A BMW Group Company



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width