开发者

How to specify the default selected Radiobutton in MFC?

开发者 https://www.devze.com 2023-02-15 04:56 出处:网络
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.

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


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


DDX_Radio


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消