Checkbox_changed event (logic question)

closet geek

Newcomer
Joined
Apr 2, 2006
Messages
21
I have a checkbox_changed event. Inside that event I have two for loops, one performs the exact opposite action of the other (e.g. if one painted a textbox black the other would paint it white).

When the checkbox is checked by the user I want one of the loops to run, when it is unchecked I want the other loop to run. How do I go about doing that?
 
C#:
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
    if (checkBox1.Checked == true)
    {
        //do whatever should happen when it is checked
    }
    else
    {
        //do whatever should happen when it is not checked
    }
}
 
Back
Top