Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking/Unchecking Radio Buttons

Status
Not open for further replies.

Jouster

Programmer
Dec 4, 2000
82
US
Wonder about the best way to do this...

Have two radio buttons grouped together (Lets say B1 and B2) and a list box on the form. When the program starts I can defualt B1 to be checked using a control variable and the setcheck(1) call. If someone picks B2 and then selects another item in the list I want to reset B1 to be checked and B2 to be blank, but they both become checked.
Any suggestions?

Thanks,
Rick
 
I think you should use AUTORADIOBUTTON instead of RADIOBUTTON in your resource script. If you use Visual Studio to design the form, rightclick the radio buttons one by one, choose "Properties", choose the "Styles" page and make sure you have checked the "Auto" checkbox on both of the radio buttons.
 
Thanks for the suggestion, they are already set to Auto.

Any others?
 
The first one must have the checkbox "Group" checked on the "General" tab page, the second one must have it unchecked.
No other controls with the "Group" checkbox checked must be between them.


 
I checked all your suggestions and still can't seem to get them to work correctly. Definately stumped on this one. I will have to figure out a work around.

Thanks for the suggestions.

 
Rick,

Could you post the part of the .rc file containing that particular dialog and the code of the callback function of the dialog?

Marcel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top