What is the difference between CheckStateChanged (check box selected status change event) and CheckedChanged (single-choice button selected status change event ?, Check box single choice
What is the difference between CheckStateChanged (check box selected status change event) and CheckedChanged (single-choice button selected status change event?
The preceding two events are used in the CheckBox and RadioButton controls, but the differences are not clear:
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}
1 using System; 2 using System. data; 3 using System. drawing; 4 using System. text; 5 using System. windows. forms; 6 namespace Test20 7 {8 public partial class Form1: Form 9 {10 public Form1 () 11 {12 InitializeComponent (); 13} 14 private void radiobutton#checkedchanged (object sender, eventArgs e) 15 {16 MessageBox. show ("RadioButton1 control selected state changed"); 17} 18 private void button1_Click (object sender, EventArgs e) 19 {20 radioButton1.Checked = true; 21} 22 private void button2_Click (object sender, EventArgs e) 23 {24 radioButton1.Checked = false; 25} 26 private void Form1_Load (object sender, EventArgs e) 27 {28 radioButton1.Checked = true; 29} 30} 31}