How does VC ++ enable the radio button and the checkbox is initially selected?

Source: Internet
Author: User

Checkdlgbutton (idc_check1, bst_unchecked); // 0 checkdlgbutton (idc_check2, bst_checked); // 1

(Cbutton *) getdlgitem (idc_radio_1)-> setcheck (1 );

You can also use Class Wizard to bind the variable to the control, set the initial value, and then call updatedata (false)

The setcheck () function is used. Table 1 is selected, and Table 0 is not selected.

All of the above are right. What I want to add is that if you are a radio button, you should combine it into a group, in this way, only a few radiobutton can be selected at the same time.

If the control you set is not in the control format, use the following statement getdlgitem (idc_button_radio1)-> setcheck (true );

Checkradiobutton (id_1, id_10, id_3); indicates that id_1 to id_10 is a group of radio, and id_3 is selected for single choice. However, id_1 to id_10 must be continuous.

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.