Click to See Complete Forum and Search --> : [RESOLVED] Checkbox


danasegarane
February 4th, 2007, 06:28 AM
Dear all,
How to check a checkbox is checked or not.That is get the status of the checkbox.And alos 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 .How do i? :)

Talikag
February 4th, 2007, 06:39 AM
There is Checkbox properties called "Checked", if its value is false the Checkbox is unchecked, and so vice versa.

Also, there's a event of the Checkbox that execute when the propertie "Checked" changes. (Means when the user click on the Checkbox). you can use this event and check there expressions (and response accordingly). For example:

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked == true)
{
group1.Enabled = true;
group2.Enabled = false;
}
else
{
group1.Enabled = false;
group2.Enabled = true;
}
}

petes1234
February 4th, 2007, 06:45 AM
couldn't have said it better

danasegarane
February 4th, 2007, 06:53 AM
Thanks you