3
Answers

For loop is exited before completion

mark c

mark c

14y
2k
1
[code]for (int d = 0; d <= checkedListBox1.Items.Count -1; d++)
{
          if (checkedListBox1.GetItemChecked(d) == true)
          {
           checkedListBox1.Items.RemoveAt(d);
         }
               
}[/code]
The for loop is completed before it's suppose to end... Why is this? I checked all the items (~20) in the checkedListBox, but when I run this code, not all the items are removed; some are left over. Why is this? I even tried removing if(checkedListBox1.GetItemChecked).                                
Answers (3)
Next Recommended Forum