vb.net

Check all checkboxes in a listview


I want to have a button that will check all checkboxes in my listview. I have:

Dim I as Integer
If listViewAccounts.CheckedItems.Count > 0 then

   (>>My Problem here<<)

End if

What to do next?


Solution

  • for i = 0 to listViewAccounts.Items.Count -1
       listViewAccounts.Items(i).Checked = true
    next