Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

Radio Buttons

I have a group of buttons in a dialog, as well as a few text fields.  I have the need to update the dialog box
inside my Dialog class.   To update the text fields, I make this call: m_text.CWnd::SetWindowText(text) and it works great.  But I am unable to update the group of  radio buttons. I have tried: m_airid.CWnd:CheckRadioButton(0,5,4)...with 0 being the first button in the group, 5 being the last, and 4 being the one I want checked off?   Any idea why this won't work.   FYI, m_airid is the first button in the group and is the only button declared as a member variable of type CButton.  In properties, it is selected as group, while the other 5 buttons are not.

Any ideas???

Thanks!!
0
smithc
Asked:
smithc
  • 2
  • 2
1 Solution
 
galkinCommented:
CheckRadioButton takes three IDs, first argument ID of the first button in group, second - ID of the last button in group, third ID of the button to check. Also be sure your ridio buttons are in group. It means the first button must have group style. The following button must be in tab order.
0
 
smithcAuthor Commented:
Thanks.   When you say argument, I assume you mean 0 for the first one and 5 for the
last one...in a six button group. I am doing this already.....The tab order is also correct?
Any thing else to look for ?

Thanks again.
0
 
galkinCommented:
No when I mean arguments I meand correct buttons IDs, for instance ID_FIST_RADIO, ID_SECOND_RADIO etc.
0
 
smithcAuthor Commented:
IT didn't seem to work.  I jsut went around it, and used CButton::SetCheck...and handled each button in the group myself.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now