I have a form with several groupboxes, each containing controls several checkboxes. I want to clear the checkboxes.
I use the following code. However it does not get cleared.
What am i doing wrong?
foreach (Control ctrl in this.Controls)
{
if (ctrl is CheckBox)
((CheckBox)(ctrl)).Checked = false;
}
Once again the checkboxes are within groupboxes.