You should use e.NewValue instead of checkedListBox1.GetItemChecked(i) . The reason is that checkedListBox1.GetItemChecked is a cached state because the ItemCheck event occurs before the internal value is updated.
This will work as you expect:
private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e) { if (e.NewValue == CheckState.Checked) { ... } else { ... } }
Secondly, about why it does not respond the first time a flag is clicked: because the CheckedListBox object requires an element that will be selected before changing the value of the flag with mouse clicks.
To achieve a similar effect, set checkedListBox1.CheckOnClick = true . This will cause the flag to be checked each time you click on the flag or the list item itself.
Jesse source share