Results 1 to 4 of 4

Thread: ListView

  1. #1

    Thread Starter
    Lively Member L0phtpDK's Avatar
    Join Date
    Mar 2001
    Location
    ILL
    Posts
    109

    Question

    Woa... They realy changed this around. Anyways, I need help on using the ListView component in the Windows Common Controls 5.0 (SP2). Is there any tutorials/help files for it? I could flat out ask u the questions that i need answered. But that would take ages.

    §tay |{ewl,
    L0phtpDK
    I have no real reason to put anything here....

  2. #2

    Thread Starter
    Lively Member L0phtpDK's Avatar
    Join Date
    Mar 2001
    Location
    ILL
    Posts
    109
    i cant beleive no one knows....
    I have no real reason to put anything here....

  3. #3
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Sydney Australia
    Posts
    804
    Example of basic operation:

    Code:
    Private Sub Command1_Click()
    'delete list items
    If ListView1.ListItems.Count > 0 Then
        ListView1.ListItems.Remove ListView1.ListItems.Count
        If ListView1.ListItems.Count > 0 Then
            ListView1.ListItems(1).Selected = True
            Me.ListView1.SetFocus 'to make selection dark blue
        End If
    End If
    End Sub
    
    Private Sub Command2_Click()
    'currently selected list item
    If Me.ListView1.ListItems.Count > 0 Then
        MsgBox "List item currently selected is a Date And is " & Me.ListView1.SelectedItem
        MsgBox "Current index selected is " & Me.ListView1.SelectedItem.Index
    End If
    End Sub
    
    Private Sub Form_Load()
    Dim li As ListItem
    With Me.ListView1
        .ColumnHeaders.Add , , "Date"
        .ColumnHeaders.Add , , "Time"
        .ColumnHeaders.Add , , "Password"
        .FullRowSelect = True
        .View = lvwReport
        .HideSelection = False 'required To make selections In code work
    
        Set li = .ListItems.Add(, , Date - 1)
        li.SubItems(1) = Time
        li.SubItems(2) = "Password"
    
        Set li = .ListItems.Add(, , Date)
        li.SubItems(1) = Time
        li.SubItems(2) = "Password"
    End With
    
    End Sub

  4. #4

    Thread Starter
    Lively Member L0phtpDK's Avatar
    Join Date
    Mar 2001
    Location
    ILL
    Posts
    109
    thanks. Thats a start, but i'm looking for a doc with more detail on how to use one.
    I have no real reason to put anything here....

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