1 usingSystem;2 usingSystem.Data;3 usingSystem.Drawing;4 usingSystem.Text;5 usingSystem.Windows.Forms;6 namespaceTest187 {8 Public Partial classForm1:form9 {Ten PublicForm1 () One { A InitializeComponent (); - } - Private voidCheckbox1_checkstatechanged (Objectsender, EventArgs e) the { -MessageBox.Show ("the control's selection state has changed"); - } - + Private voidForm1_Load (Objectsender, EventArgs e) - { + A } at - Private voidCheckbox1_checkedchanged (Objectsender, EventArgs e) - { - - } - } in}
When we double-click the form, we enter the private void Form1_Load (object sender, EventArgs e) to write the interface;
Double-click the label to enter the private void Checkbox1_checkedchanged (object sender, EventArgs e) editing interface;
Clicking the label again right-click on the property to switch to the event will find the checkbox1_checkstatechanged option and double-click on the edit interface to indicate that the space's selection state has changed to handle accordingly.
Checkbox1_checkedchanged (object sender, EventArgs e) and Checkbox1_checkstatechanged (object sender, EventArgs e) are different