paulthepaddy
Well-known member
hi all, simple problem that i just cant figure out. here is the code
this code works fine as long as i dont remove ALL items, the error i am getting is index is out of bounds of the array, i have tried -1, -2 0 +1 +2 and all are still giving this error, i cant just create code for remove all as i wont always need all removed so i kinda of have to get this code or something similar to remove only checked items. the code below is code i have tried
i just dont seee whats wrogn with the code i tried first.
VB.NET:
For i = 0 To CheckedListBox_Car.CheckedItems.Count -1
CheckedListBox_Car.Items.Remove(CheckedListBox_Car.CheckedItems.Item(i))
Next
VB.NET:
CheckedListBox_Car.Items.Remove(CheckedListBox_Car.CheckedItems)
VB.NET:
For Each Item In CheckedListBox_Car.checkedItems
CheckedListBox_Car.Items.Remove(item)
Next
i just dont seee whats wrogn with the code i tried first.