I am working on a VC++ program in VS.Net 2003. I am following the
instructions in the help for putting a group of radio buttons on a form.
1) Put 3 radio buttons on the form.
2) Make sure they are seqential in the tab order.
3) For the first one in the tab order, set the Group property to true.
4) Right click the first one in the tab order and select Add variable.
5) Select the Control check box.
6) From the Category list select value.
7) Enter a name for the variable.
8) From the Variable Type list select int.
It's the last step that is throwing me - the list offers only type BOOL. How
can a type BOOL give me info on which of 3 radio buttons is selected? What
am I doing wrong?
Thanks,

Signature
Peter Aitken
Remove the crap from my email address before using.
Severian - 18 Mar 2005 05:20 GMT
>I am working on a VC++ program in VS.Net 2003. I am following the
>instructions in the help for putting a group of radio buttons on a form.
[quoted text clipped - 11 lines]
>can a type BOOL give me info on which of 3 radio buttons is selected? What
>am I doing wrong?
You have to check the state of each button (or at least 2 of the 3,
and assume that if neither is, then it is 3). Only one should be
selected.
Pseudocode:
if (button1 is checked)
checked_button = 1
else if (button2 is checked)
checked_button = 2
else
checked_button = 3
I wrote a C variadic function that will take any number of button IDs
and return the ID that is selected, but I don't have the code
available to show right now.
There may be shortcuts to this in MFC, but I don't use it.
--
Sev
Peter Aitken - 18 Mar 2005 14:13 GMT
>>I am working on a VC++ program in VS.Net 2003. I am following the
>>instructions in the help for putting a group of radio buttons on a form.
[quoted text clipped - 25 lines]
> else
> checked_button = 3
So I'd attach a BOOL to each button and check each one individually?
Thanks,
Peter
Peter van der Goes - 20 Mar 2005 16:24 GMT
>I am working on a VC++ program in VS.Net 2003. I am following the
>instructions in the help for putting a group of radio buttons on a form.
[quoted text clipped - 13 lines]
>
> Thanks,
The key phrase in the help article you missed is:
"In the Variable type list box, select int or ***type*** int."
(Asterisks added for emphasis).
If you type "int" into the combo box, your variables will be created as
described.

Signature
Peter [MVP Visual Developer]
Jack of all trades, master of none.