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

Source: Internet
Author: User

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}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.