Reputation: 63
If you have a CheckedListBox with CheckOnClick = False the ItemCheck event will not fire when the item is checked IF it is first selected...pause...then click again to check the item. But if it is a quick double click with no pause the event will fire.
Is this the correct behavior? The ItemCheck event should fire regardless of the click speed, right?
I believe this is strange behavior that is easy to replicate:
Has anyone else ran into this issue?
EDIT 5/1/2015
The problem is that the SelectedIndexChanged event gets fired directly after the ItemCheck event. That means it gets fired before every ItemCheck and then immediately after. The label will not show the change as it happens too fast, but switching to MessageBox.Show() verifies that it is getting fired directly after.
Upvotes: 0
Views: 1448
Reputation: 63
The problem is that the SelectedIndexChanged event gets fired directly after the ItemCheck event. That means it gets fired before every ItemCheck and then immediately after. The label will not show the change as it happens too fast, but switching to MessageBox.Show() verifies that it is getting fired directly after.
Upvotes: 1
Reputation: 753
according to MSDN checkedlistbox.checkonclick (read the remarks section) check on click property controls whether the list box item is checked on the first click or on the second click. in your case where check on click is flase it requires two clicks to check the item thus firing the ItemCheck event.
Upvotes: 0