How to specify the default selected Radiobutton in MFC?

11,323

Use the CheckRadioButton to set the state of the radio buttons.

Share:
11,323
marc40000
Author by

marc40000

:)

Updated on June 05, 2022

Comments

  • marc40000
    marc40000 over 1 year

    I have two radiobuttons on my dialog. I set up the tabstop order correctly and turned the group property on on one of them and added an int member variable which I can read.

    What I'm wondering now is: How can I preselect a default option? Right now, when the dialog gets created, no radiobutton ist visually selected. Doing m_membervariable = 1; compiles, but it also doesn't select a radiobutton. How can I do that?

    I checked tutorials like http://www.functionx.com/visualc/controls/radiobutton.htm and http://www.cpp-tutor.de/mfc/mfc/kap8/lektion2.htm but they seem to ommit that.

    Best regards Marc