I have a series of CheckBox
(es) in a GroupBox
that select what reports a user would like to run. They are normally all Checked
, the most common case, but it is is also common to want to run just one. I thought using a right-click on a box to turn it on and all the others off would be useful.
It's easy enough to implement a MouseClick
event on the check boxes, but the problem is that there are a bunch of them, and the list keeps getting added to. So the first question: is there a way to have a single MouseClick
handler that works for any check box, even ones we don't have yet?
The other option would seem to be to use the GroupBox.Controls
collection to loop over the check boxes and see which one was clicked and then set the Checked
for all of them as appropriate. However, it seems that the CheckBox
always intercepts the MouseClick
event, even with AutoCheck
turned off. So my second question: is there a way to turn off click handling in the check boxes so that event can be handled by the group?
If there is any other way to handle this, please let me know!