How can I select and unselect check boxes in Winform?
My code only doing if chckAll.Checked than make all the check boxes
selected... What I want to achieve is when any of the check boxes
unselected, after selecting all the check boxes make the chckAll
unselected.... Also If all the check boxes selected by one by than make
the chckAll selected...How can I do that?
private void chckAll_CheckedChanged(object sender, EventArgs e)
{
if (chckAll.Checked)
{
foreach (Control ctrl in checkBoxesPanel3.Controls)
{
CheckBox chkboxes = ctrl as CheckBox;
if (chkboxes != null)
{
chkboxes.Checked = true;
}
}
}
}
No comments:
Post a Comment