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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toggle Checkbox State Listview Checked/Unchecked? 1

Status
Not open for further replies.

Rob7412

Technical User
Jan 26, 2006
31
US
Probably Simple but I can't seem to get it working.

I need to have a button on a form that sets all items in my listview checkboxes to checked and another to uncheck. Any help would be appreciated. THX.
 
Hi,

Loop through all of the items in the Listview and either set the checked to True or False depending on if you want them checked or not, e.g.
Code:
For i = 1 To ListView2.ListItems.Count
ListView2.ListItems(i).Checked = True
Next i
Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Glad I could help, thanks for the star [smile]

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top