|
-
Jul 29th, 2003, 06:55 AM
#1
Thread Starter
Lively Member
Listview Remove Item
Hi,
I Have a listview with checkboxes,how can I remove the Items that have been checked from the listview?
thanks
-
Jul 29th, 2003, 07:35 AM
#2
Hyperactive Member
Don't know if this is the best way but it's the only one I know
Code:
Dim i
For i = ListView1.ListItems.Count To 1 Step (-1)
If ListView1.ListItems(i).Selected = True Then
ListView1.ListItems.Remove (i)
End If
Next i
-
Jul 29th, 2003, 07:37 AM
#3
Originally posted by jdc6029
Don't know if this is the best way but it's the only one I know
Code:
Dim i
For i = ListView1.ListItems.Count To 1 Step (-1)
If ListView1.ListItems(i).Selected = True Then
ListView1.ListItems.Remove (i)
End If
Next i
Well
I would dim i as an integer instead of variant
and you would want to check the .Checked property.. not the selected property.. selected is if the listitem is currently highlighted
-
Jul 29th, 2003, 10:25 AM
#4
Hyperactive Member
I would dim i as an integer instead of variant
and you would want to check the .Checked property.. not the selected property.. selected is if the listitem is currently highlighted
You're right, I forgot to change Selected to Checked before I posted and thanks for the tip about As Integer
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
|