Jul 7, 2011
Loop through un checking all the Check boxes
private void button3_Click(object sender, EventArgs e)
{
Form1 frm = new Form1();
int i = 0;
foreach (Control ctrl in this.Controls)
{
if (ctrl is CheckBox)
{
//cast the ctrl to a checkbox and disable it
//if (((CheckBox)ctrl).Checked == true)
//{
// i++;
//}
((CheckBox)ctrl).Checked = false;
}
}
//MessageBox.Show(i.ToString());
}
he out put is given below
when ever u click the button it will unchecked the all checked check boxes in the form
Labels:
c#.net,
check boxes
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment