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.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hussain AhmedPosted May 18, 2014, 2:56 AM
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;
}