Checkbox Question

Hello there.

I have a problem.

I have an OK button and a Checkbox right now. I want to make it so that when a user checks the CheckBox, the OK button is enabled.

Is this possible


Answer this question

Checkbox Question

  • Bill Fisher

    Thanks you two.
  • MSJ

    hi,

    yes its possible you can try this

    private void checkBox1_CheckedChanged(object sender, EventArgs e)

    {

    if (checkBox1.Checked == true)

    button1.Enabled = true;

    else

    button1.Enabled = false;

    }

    hope this helps



  • Darrin Dyson

    Or, shorter:

    button1.Enabled = checkBox1.Checked;



  • Checkbox Question