c#之checkbox是否被选中

if (checkBox1.CheckState == CheckState.Checked)
            {
                MessageBox.Show("checkbox1 is checked\n" + checkBox1.Text  );
            }
            else if (checkBox1.CheckState == CheckState.Unchecked)
            {
                MessageBox.Show("checkbox1 is Unchecked\n" + checkBox1.Text);
            }
            else
            {
                MessageBox.Show("checkBox1 控件处于不确定状态");
            }
            //...

你可能感兴趣的:(c#)