Solved

Radio Buttons

Posted on 1998-06-24
4
217 Views
Last Modified: 2013-11-20
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
Comment
Question by:smithc
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 100 total points
ID: 1318380
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
 

Author Comment

by:smithc
ID: 1318381
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
 
LVL 7

Expert Comment

by:galkin
ID: 1318382
No when I mean arguments I meand correct buttons IDs, for instance ID_FIST_RADIO, ID_SECOND_RADIO etc.
0
 

Author Comment

by:smithc
ID: 1318383
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Rewrite URL With Encoded Characters 6 75
Expand LInux Boot partition remotly 3 86
Define unique primary key 9 89
Making an alias 7 80
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now