473,327 Members | 2,112 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,327 software developers and data experts.

using GroupBox control with radio buttons - get selected value?

Hello,

If I place a groupbox control (gb1) on a form and add 2 radion buttons where
rad1 represents a value of 1 of rad2 a value of 2 --- when I click on rad1 I
want a messagebox to show the value "1", when I click rad2 a messagebox shows
the value "2". Yes, in the click event of each radio button this is no
sweat. But I thought there was a way to consolidate that by using an event
in the groupbox: Here is my Pseudo Code

Private sub gb1_click(...) handles gb1
If rad1.Checked.Equals(True) Then MessageBox.Show("1")
If rad2.Checked.Equals(True) The MessageBox.Show("2")
End Sub

Is something like this doable? How to do it? My sample above doesn't work.

When I click on rad1, rad2 becomes unchecked. When I click on rad2, rad1
becomes unchecked. So that part is working correctly. How to retrieve the
desired value from gb1?

Thanks,
Rich
Nov 21 '05 #1
2 4925
Is something like this doable? How to do it? My sample above doesn't work.


Sure, a method can handle multiple events. Try it like this

Private Sub RadioClickHandler(sender As Object, e As EventArgs)
Handles rad1.Click, rad2.Click
Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 21 '05 #2
Thanks. I believe that is what I was looking for.

Rich

"Mattias Sjögren" wrote:
Is something like this doable? How to do it? My sample above doesn't work.


Sure, a method can handle multiple events. Try it like this

Private Sub RadioClickHandler(sender As Object, e As EventArgs)
Handles rad1.Click, rad2.Click
Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 21 '05 #3

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

Similar topics

3
by: Suzanne | last post by:
Hi, I have a form which our clients can fill in with their personal details. As part of the information we store there is a section - areas of interest - this is a number of radio buttons. ...
24
by: London | last post by:
Hello Can you help me. By ASP How can I get the dropdown(control'name)'s selected value? What is it's property'name?
0
by: darag2358 | last post by:
Trying to automate some processes and I need to know how you change the state of radio buttons on a web page using visual basic. I've tried: set ip = ie.document.all.item(\"selectid\") 'this...
4
by: nz mark in aus | last post by:
Hi there I am populating an empty <asp:dropdownlist on the client side using Javascript using the following code Heres my dropdown list <asp:dropdownlist id="ddlDealers"...
0
by: sanmateof | last post by:
My radio buttons are showing the value besides the button even though no text is displayed. Below is my code: <td style="width: 100px"><asp:RadioButtonList ID="RadioButtonList16" runat="server"...
5
by: alanb | last post by:
Hi, hope someone can help, I need to be able to keep a running total of radio buttons selected, as a user goes through a set of 16 questions, devided in to 4 catorgories, then on "submit" have the...
3
by: MazzaBee | last post by:
Hi all Complete newbie. Have a table posing the question "Which do you like best"? Two possible responses. Want to replace radio buttons COMLETELY with images that represent those possible...
4
by: Gugale at Lincoln | last post by:
Hi, I am using reflection to read names from enum and creating radio buttons inside a groupbox. Everything is working fine. However, I am not able to adjust the size of the group box to fit the...
1
by: sreegans | last post by:
Hi.. I'm using 2 radio buttons in my form, for the user to select male or female.. How to insert this value into the database.... Any one pl help.. Sree.
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.