I have a checkbox on a form.
When the user checks this I want to run a routing which loops through checkboxes on a panel control and sets their checked status to the opposite so if the initial box is checked I need to uncheck all the others.
The problem is that when I check or uncheck a box its Checked event handler is fired so I end up with a stack overflow problem.
Dont ask me why I can't use a group control. I just cant in this case
This means that I have to unwire the event handler and then rewire it when I am finished.
This is what I have :
How do I get a handle on the delegate ?Code:private void ChechUncheckBoxes(CheckBox cbx) { bool ticked = cbx.Checked; foreach (Control c in pnlSingle.Controls) { if (c is CheckBox && c.Name != cbx.Name) { //Need to unwire here ((CheckBox)c).Checked = !ticked; //this causes a stack overflow //Need to rewire here } } }
Thanks In Advance![]()





Reply With Quote