3
votes

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

3

3 Answers

5
votes

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

-1
votes

You should define the range of the available values for your radio buttons in String Table. So if you have two controls, you specify 0 and 1, so the first value for m_membervariable is for your first control and the second one for your second.