What is the difference between the checkedchanged of a C # CheckBox control and Checkedstatechanged

Source: Internet
Author: User

CheckedChanged:

This event is raised when the value of the checked property changes. Note In the check box, when the ThreeState property is true, clicking the check box may not change the checked property. This occurs when the check box changes from checked to indeterminate state.

Note

ThreeState property: Used to return or set whether a check box can represent three states, and if the property value is true, it can represent: three states-checked, unchecked, and intermediate (checkstate.checked, Checkstate.unchecked and CheckState.Indeterminate), when the property value is false, only two states are represented-checked and unchecked.

Checked property: Used to set or return whether a check box is selected, or true to indicate that the check box is not selected when the checkbox is selected and the value is false. When the ThreeState property value is true, the intermediate state also indicates that it is selected.

CheckState property: The state used to set or return a check box. When the ThreeState property value is False, the value is checkstate.checked or checkstate.unchecked. When the ThreeState property value is set to True, CheckState can also take a value checkstate.indeterminate, at which point the check box is displayed in a light gray checked state, which typically indicates that multiple child options under this option are not fully selected.

Checkedstatechanged:

This event is raised when the Checkedstate property changes. The value of the Checkedstate property can be checked and Unchecked. This event is raised whenever the checked property changes. In addition, the event is raised when the state changes from checked to indeterminate.

For the same CheckBox control, enter checkbox1_checkedchanged (object Sender,eventargse) and checkbox1_checkstatechanged (Objectsender , the order of EventArgs E) is: First enter the CheckedChanged event, then enter the CheckStateChanged event.

This paper url:http://www.bianceng.cn/programming/csharp/201410/45586.htm

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.