Hello,
I have several check boxes on one the form and I want to implement a code that check/uncheck all the check boxes once I click on the command button.
The default status of all the check boxes is Checked.
Check/Uncheck checkBoxes
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Hussain AhmedRank #1,271 · 1.4K reputationPosted May 17, 2014, 10:56 PM EDT
Checked All Button:
foreach (Control control in this.Controls)
{
if (control is CheckBox)
((CheckBox)(control)).Checked = true;
}
Unchecked All Button:
foreach (Control control in this.Controls)
{
if (control is CheckBox)
((CheckBox)(control)).Checked = false;
}