Dear all,
How to check a checkbox is checked or not.That is get the status of the checkbox
Printable View
Dear all,
How to check a checkbox is checked or not.That is get the status of the checkbox
Code:if (checkBox1.Checked)
{
// do whatever
}
Thanks BM,
I have two groupbox.How to toggle the enabled property of the two group box with respect to the state of the checkbox.
If the checkbox is checked,One groupbox should be enabled and one should be disabled and vice versa
set groupBox2.Enabled = False at design timeor, being obtuse:Code:private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
groupBox1.Enabled = !checkBox1.Checked;
groupBox2.Enabled = checkBox1.Checked;
}
Code:private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
groupBox1.Enabled = !(groupBox2.Enabled = checkBox1.Checked);
}