|
-
Nov 28th, 2001, 08:22 AM
#1
checked listview problem
I have a listview that I have set to have checkboxes. I need to see if a user has ticked any of the checkboxes.. What is the code to do this?
-
Nov 28th, 2001, 08:27 AM
#2
Use the Checked property of a ListView item
VB Code:
Dim itm As ListItem
For Each itm In ListView1.ListItems
If itm.Checked = True Then
Debug.Print itm.Text & " is checked"
End If
Next
Best regards
-
Nov 28th, 2001, 08:31 AM
#3
VB Code:
Dim i As Long
For i = ListView1.ListItems.Count To 0 Step -1
If Listview1.SelectedItem.Selected(i) = True Then Exit For
'if just one item is checked, then it stops
Else
'it went through the entire ListView and didn't find anything selected
End If
Next
-
Nov 28th, 2001, 08:32 AM
#4
Hmmm...Joacim types faster than I do
-
Nov 28th, 2001, 08:33 AM
#5
Well, the selected property can be False even if you have checked one item.
To control the check boxes go with the Checked property.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|