If statements for Checkboxes

前端 未结 6 1106
刺人心
刺人心 2021-02-18 23:43

I wanted to know how to write if statements to see if one or another check box is checked or not.

I have two check boxes. I wanted it to check to see if checkbox 1 is c

6条回答
  •  北海茫月
    2021-02-19 00:13

    private void checkBox1_CheckedChanged(object sender, EventArgs e)
    {
        if (checkBoxImage.Checked)
        {
            groupBoxImage.Show();
        }
        else if (!checkBoxImage.Checked)
        {
            groupBoxImage.Hide(); 
        }
    }
    

提交回复
热议问题