Click to See Complete Forum and Search --> : Radio Buttons?
Charlie Curtis
May 19th, 1999, 03:29 PM
I have three radio buttons IDC_RADIO1, IDC_RADIO2 and IDC_RADIO3 IDC_RADIO1 has the group property set and has a member variable (m_radioGrp) of type CButton and the other two do not have anything set. I am able to enable/disable the first button as I please, but can someone please tell me how to do the same for the other two? I have m_radioGrp.SetCheck(0) and this works fine on IDC_RADIO1, but I can't seem to get the other two Radio's to respond to anything! Please provide some code if possible and also can you
explain why m_radioGrp.CheckRadioButton(0,2,1) doesn't work? I also tried the Control ID numbers 1042,1044,1043 in place of 0,2,1 won't work either? Any assistance is greatly appreciated!
Thanks!
Charlie
Wayne Fuller
May 19th, 1999, 03:41 PM
From what you have told me you only have one radio button that has a CButton that is associated with it. Try this instead of calling m_radioGrp.CheckRadioButton(...) call the CDialog version CheckRadioButton(...). That call is from the CWnd class, so even though you can call it with your CButton class, it doesn't make sense. You can either call the CheckRadioButton(...) or map 3 CButton classes (each of your radio buttons) and call the member functions such as SetCheck.
Wayne
Charlie Curtis
May 19th, 1999, 04:33 PM
THANK YOU VERY MUCH Wayne! The CDialog CheckRadioButton did the trick!
This has been a trial but thanks to you I can now get on with it! Thanks Again!
Rail Jon Rogut
May 19th, 1999, 04:44 PM
Another method, is to set the group style for all the radio buttons, then in ClassWizard create member variables for each button. You can then go back and unselect the group style for the appropriate buttons. You can use EnableWindow() to enable/disable the buttons.
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
railro@earthlink.net
http://home.earthlink.net/~railro/
Charlie Curtis
May 20th, 1999, 09:21 AM
Rail,
I thought about doing it that way, but couldn't figure out how to implement. You have provided enough info so I can give this a try as well.
Thanks!
Charlie
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.