Hi,
I Have a listview with checkboxes,how can I remove the Items that have been checked from the listview?
thanks
Printable View
Hi,
I Have a listview with checkboxes,how can I remove the Items that have been checked from the listview?
thanks
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
WellQuote:
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
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 IntegerQuote:
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