Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListView Multiple Checked Boxes 1

Status
Not open for further replies.

jw45

Programmer
May 27, 2005
56
US
I have a ListView which I have set the following:
Code:
    With Me.ListView1
        'Set ListView style
        .View = lvwReport
        .GridLines = True
        .MultiSelect = True
        .FullRowSelect = True
        .Checkboxes = True
        .ListItems.Clear
        .ColumnHeaders.Clear
    End With

The ListView is displayed correctly and has a checkbox at the begining of each line. I can then place a check mark in any item I choose.

I want to be able to click a command button and determine which lines/items I have checked.

Can someone help me?
 
For i = 1 To Me.ListView1.ListItems.Count
If Me.ListView1.ListItems(i).Checked Then
' checked stuff
Else
' unchecked stuff
End If
Next i


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I had previosly tried this:
Code:
If ListView1.ListItems(i).Checked Then

had to add the Me. to make it work
Code:
If [red]Me.[/red]ListView1.ListItems(i).Checked Then

Thanks for your help PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top