Checkbox‑checkedchanged (object sender, EventArgs e) is different from checkbox‑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 checkbox#checkstatechanged (object sender, eventArgs e) 15 {16 MessageBox. show ("Control Selection status changed"); 17} 18 19 private void Form1_Load (object sender, EventArgs e) 20 {21 22} 23 24 private void checkbox#checkedchanged (object sender, eventArgs e) 25 {26 27} 28} 29}
When double-click the form, the private void Form1_Load (object sender, EventArgs e) Compiling interface is displayed;
Double-click Label to go to the private void checkbox‑checkedchanged (object sender, EventArgs e) editing interface;
Click Label, right-click the attribute, and switch to the event. The checkbox‑checkstatechanged option is displayed. Double-click the attribute to enter the editing page, indicating that the corresponding processing is performed when the selection status of the space changes.