Results 1 to 3 of 3

Thread: Verify rows from Listview checked

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Verify rows from Listview checked

    Hi

    I have a Listview with checkbox, I want all rows from Listview and verify what are checked

    How can I do It ?


    Tia

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Verify rows from Listview checked

    Loop through all items in the ListView

    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim oItem As ListItem
    3.     For Each oItem In Me.ListView1.ListItems
    4.         If oItem.Checked Then
    5.             'do something
    6.         End If
    7.     Next
    8. End Sub

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Verify rows from Listview checked

    Another way
    VB Code:
    1. Dim i As Long
    2. For i = 1 To ListView1.ListItems.Count
    3.     If ListView1.ListItems.Item(i).Checked = True Then
    4.        'do something
    5.     End If
    6. Next

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