473,388 Members | 1,234 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Radio Buttons don't work.

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,
--
Peter Aitken

Remove the crap from my email address before using.
Nov 17 '05 #1
3 1401
On Thu, 17 Mar 2005 15:06:55 -0500, "Peter Aitken"
<pa*****@CRAPnc.rr.com> wrote:
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?


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
Nov 17 '05 #2
"Severian" <se******@chlamydia-is-not-a-flower.com> wrote in message
news:7k********************************@4ax.com...
On Thu, 17 Mar 2005 15:06:55 -0500, "Peter Aitken"
<pa*****@CRAPnc.rr.com> wrote:
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?


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


So I'd attach a BOOL to each button and check each one individually?

Thanks,

Peter
Nov 17 '05 #3

"Peter Aitken" <pa*****@CRAPnc.rr.com> wrote in message
news:eF**************@TK2MSFTNGP10.phx.gbl...
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,
--
Peter Aitken

Remove the crap from my email address before using.

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.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jeff | last post by:
I'm trying to create a dynamic form that can have multiple groups of radio buttons (each group has two buttons) with the same name. Essentially, the form allows a user to enter as many names as...
4
by: Oscar Monteiro | last post by:
I Have to sets of Radio buttons like so: <input type="radio" name=p1 value=1> <input type="radio" name=p1 value=2> <input type="radio" name=p1 value=3> <br> <input type="radio" name=p2 value=1>...
3
by: Jay | last post by:
I noticed somewhere on the net that a post mentioned that there was a bug in the datagrid, radio buttons and a repeater. Something about the radio buttons are not mutually exclusive. (will this be...
2
by: Rob | last post by:
Hi all, I've got multiple sets of radio button that are dynamically created in code and populated by a database query. The query returns about 20 recordsets with 3 radio buttons per recordset and...
3
by: Ferret Face | last post by:
Hello, I have a web page that gets the user to select items from a list of options. This list is a set of independant Radio Buttons. I did not use a Radio Button List because I wanted the...
2
by: NishSF | last post by:
Would anyone have any suggestions/javascript code so that if one clicks the Radio Button "Yes" below he has the option of selecting any of the six CheckBox below. If the user clicks on Radio Button...
16
by: Stuart | last post by:
I have a page where I utilise the left and right cursor keys to change an image, also on this page is a groups of radio buttons, unfortunately when a radio button is clicked the focus for the...
24
by: Mike Otten | last post by:
Any help greatly appreciated. The validated page is at: http://myweb.stedwards.edu/michaelo/ddtab.htm The trouble is with the radio buttons (2/3-down the left column). The radios are...
1
by: kenny8787 | last post by:
Hi, can anyone help here? I have the following code generated from a database, I want to have javascript calculate the costs of the selected items using radio buttons, subtotal the costs and...
11
by: Twayne | last post by:
Hi, Newbie to PHP here, no C or other relevant background, so pretty niave w/r to the nuances etc. but I think this is pretty basic. XP Pro, SP2+, PHP 4.4.7, XAMPP Local Apache Server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.