473,387 Members | 1,650 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,387 software developers and data experts.

Radio button GroupName property

FOR WINDOWS FORMS

I've been setting all Radio buttons in a group to Checked=False except the
clicked one which I set to True.

I just noticed the GroupName property and if I understand the doc it will do
that for me automatically. Is that correct?
I would not post for the above (I could just try). The reason for this post
is:

If a group of buttons have the same GroupName and I want, say, the Text
property of the checked one - how do I get it?

Also, I don't set the GroupName in the property listing of a Radio Button.
Is it only for Web controls?

If so, are there any short-cuts for Windows?

Thanks
Nov 20 '05 #1
3 2519
REVISED - I got confused with CheckBoxes

If a group of buttons are in the same GroupBox and I want, say, the Text
property of the checked one - how do I get it?

Also, I don't set the GroupName in the property listing of a Radio Button.
Is it only for Web controls?

If so, are there any short-cuts for accessing a checked button property for
Windows?

Thanks


Nov 20 '05 #2
* " SamSpade" <st**************@REMOVEaol.com> scripsit:
FOR WINDOWS FORMS

I've been setting all Radio buttons in a group to Checked=False except the
clicked one which I set to True.

I just noticed the GroupName property and if I understand the doc it will do
that for me automatically. Is that correct?
I would not post for the above (I could just try). The reason for this post
is:

If a group of buttons have the same GroupName and I want, say, the Text
property of the checked one - how do I get it?

Also, I don't set the GroupName in the property listing of a Radio Button.
Is it only for Web controls?


Add all of the radio buttons to a groupbox. Then add a common handler
to the radio buttons' 'CheckedChanged' event using 'AddHandler'. In the
handler, you set a private variable of type string to
'DirectCast(sender, RadioButton).Name'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3
Thanks, works great
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2g************@uni-berlin.de...
* " SamSpade" <st**************@REMOVEaol.com> scripsit:
FOR WINDOWS FORMS

I've been setting all Radio buttons in a group to Checked=False except the clicked one which I set to True.

I just noticed the GroupName property and if I understand the doc it will do that for me automatically. Is that correct?
I would not post for the above (I could just try). The reason for this post is:

If a group of buttons have the same GroupName and I want, say, the Text
property of the checked one - how do I get it?

Also, I don't set the GroupName in the property listing of a Radio Button. Is it only for Web controls?


Add all of the radio buttons to a groupbox. Then add a common handler
to the radio buttons' 'CheckedChanged' event using 'AddHandler'. In the
handler, you set a private variable of type string to
'DirectCast(sender, RadioButton).Name'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #4

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

Similar topics

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...
2
by: cindy | last post by:
When my datalist loads I am trying to make the checked value in a radio button group reflect which value is stored in the data and then fire and event when the CheckChanged event fires. private...
0
by: Shadow Lynx | last post by:
In standard HTML, the <INPUT type="radio" name="x" /control only allows one radio button to be checked at a time. When more than one are set as checked="true" then only the last one rendered...
3
by: ToddFur | last post by:
I see several postings on this but I am still unable to figure out my problem. I can pass the values of my text field but not radio button (or even checkboxes). My PHP file <?php //declare...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.