I have a CheckedListBox previously populated. I want to loop with a "for each / next" through all items in the CheckedListBox and do a lot of "stuff" with each iteration element of the checkedlistbox.
For Each item In CheckedListBox1.Items
If item.Checked = True Then
'do stuff like
item.BackColor = Color.Blue
'do other stuff
item.BackColor = Color.Brown
CheckedListBox is not a collection of
It does not have a collection of wrapper objects.
The CheckedListBox control is a simple control that can only display a plain list of items; it sounds like you're looking for something more powerful. (For example, it is impossible to change the background color of an individual item without owner-drawing)
You should use a
ListView (with the
CheckBoxes property set to true) instead.
You can then loop through the
ListViewItem instances in its