how do i check all the boxes avaliable on a listview or uncheck all at 1 time? is there a simple function for it or i have to use a for loop a check all 1 by 1?
Printable View
how do i check all the boxes avaliable on a listview or uncheck all at 1 time? is there a simple function for it or i have to use a for loop a check all 1 by 1?
I think you have to use a loop and check all of them manually. :(
Check/uncheck all items in a listview:
VB Code:
For i = 1 To ListView1.ListItems.Count ListView1.ListItems(i).Checked = Not ListView1.ListItems(i).Checked Next
can you explain the codes please......
i dont understand the logic
thanks alot it works
With Comments:
VB Code:
For i = 1 To ListView1.ListItems.Count 'start the loop through all the items in the listview ListView1.ListItems(i).Checked = Not ListView1.ListItems (i).Checked 'if the checkbox on listitem(i) 'is checked, it will uncheck it, 'if it is unchecked, it will check it 'Using Not is like saying set the value 'to the opposite of the current state Next 'start the loop over...