checkBox1_CheckedChanged(object sender, EventArgs e)和checkBox1_CheckStateChanged(object sender, EventArgs e)不同
1 using System; 2 using System.Data; 3 using System.Drawing; 4 using System.Text; 5 using System.Windows.Forms; 6 namespace Test18 7 { 8 public partial class Form1 : Form 9 { 10 public Form1() 11 { 12 InitializeComponent(); 13 } 14 private void checkBox1_CheckStateChanged(object sender, EventArgs e) 15 { 16 MessageBox.Show("控件的选择状态发生改变"); 17 } 18 19 private void Form1_Load(object sender, EventArgs e) 20 { 21 22 } 23 24 private void checkBox1_CheckedChanged(object sender, EventArgs e) 25 { 26 27 } 28 } 29 }
当我们双击窗体的时候,就进入了private void Form1_Load(object sender, EventArgs e)编写界面;
双击Label就进入了private void checkBox1_CheckedChanged(object sender, EventArgs e)编辑界面;
单击Label再右键属性,切换到事件,会找到checkBox1_CheckStateChanged选项,双击进入编辑界面,用以表示空间的选择状态发生改变时进行相应处理。
实事求是,不自以为是