I think that you want to handle the selection of some of the switches inside the group box using the group core control itself .
Perhaps you need to basically avoid code repetition.
(i.e.) adding a check change event for the entire switch in the designer, which can be tedious when there is more control. Since it is already in the group, why not use the group control object to control the controls with it and set events.
This is how I understood your problem and therefore the solution as below.
Set a common handler for all radio button controls in the group field
for (int i = 0; i < groupBox.Controls.Count; i++) { RadioButton rb = (RadioButton)groupBox.Controls[i]; rb.CheckedChanged += new System.EventHandler(evntHandler); }
Inside the handler, you can determine which button has been changed, as indicated by others, and perform the necessary actions.
AKN
source share