Results 1 to 3 of 3

Thread: advanced listboxes

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    8

    Post

    i want to add a listbox with columns to my program. there is a 'ListView' control in 'Microsoft's Common Controls' that i thought was what i wanted, but i can't seem to use it right. i went to its properties and created columns, but they didn't show up and i don't know how to add anything to the list either. the only example of these lists i can think of is on the 'transfer' screen of napster( http://www.napster.com/ ). i know i've seen these in many places, but i can't think of any other examples. can anyone help? thanks

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

    -cxs
    bloodhoundgang@home.com

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

    Post

    Here's how you use a ListView with Multiple Columns:
    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
    Feb 2000
    Posts
    8

    Post

    thanks aaron ;D


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

    -cxs
    bloodhoundgang@home.com

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