I want to iterate through a CheckedListView and delete the checked items ONLY.
Anybody know how to do this? Anybody know a rock solid way of doing this?
I have tried the following but get an exception
unhandled exception of type System.InvalidOperationException in
system.windows.forms.dll
Additionlal Info: The list that this enumerator is bound to has been
modified.
An enumerator can only be used if the list dosn't change.
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnDelete.Click
Dim indexChecked, itemCount As Integer
Dim itemChecked As Object = ChkListBoxRoutines.CheckedItems
For Each itemChecked In itemChecked
ChkListBoxRoutines.Items.RemoveAt(indexChecked)
ChkListBoxRoutines.Refresh()
Next
End Sub