473,486 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

validate radio button in groupbox

Hi,
I am a complete beginner and need help with a form. There are 2 group
boxes, each containing 3 radio buttons on my form.
I'd like to write a subroutine in a module that checks to be sure that the
user has selected 1 radio button from each groupbox.
How can I do this using Visual Studio 2005 (vb code only)?
Thanks
Oct 21 '06 #1
2 5542
You can try something like:

if check1.checked
is checked
elseif check2.checked
is checked
elseif check3.checked
is checked
else
no one is checked
end if
On Sat, 21 Oct 2006 17:30:59 +0100, K Forester <kf*******@sympatico.ca>
wrote:
Hi,
I am a complete beginner and need help with a form. There are 2 group
boxes, each containing 3 radio buttons on my form.
I'd like to write a subroutine in a module that checks to be sure that
the
user has selected 1 radio button from each groupbox.
How can I do this using Visual Studio 2005 (vb code only)?
Thanks



--
Tiago Salgado // http://weblogs.pontonetpt.com/tiagosalgado
Oct 21 '06 #2
You could also build a global method that would handle all the radios
in the groupbox. This method could then set a set a property indicating
that the user checked one of the radios. Also, you could loop through
the groupbox's controls and use Addhandler to map the events to this
handler - this would automatically add new radios to the handler (if
you plan on adding more than 3 radios to the groupboxes). However, if
you plan on just using the 3 radios, it might be easier to use the
if...then tests.

Thanks,

Seth Rowe
Tiago Salgado wrote:
You can try something like:

if check1.checked
is checked
elseif check2.checked
is checked
elseif check3.checked
is checked
else
no one is checked
end if
On Sat, 21 Oct 2006 17:30:59 +0100, K Forester <kf*******@sympatico.ca>
wrote:
Hi,
I am a complete beginner and need help with a form. There are 2 group
boxes, each containing 3 radio buttons on my form.
I'd like to write a subroutine in a module that checks to be sure that
the
user has selected 1 radio button from each groupbox.
How can I do this using Visual Studio 2005 (vb code only)?
Thanks

--
Tiago Salgado // http://weblogs.pontonetpt.com/tiagosalgado
Oct 22 '06 #3

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

Similar topics

1
1921
by: Savvas | last post by:
Dear Cor Ligthert My account is not yet validated so i cannot log in to reply directly to you. An analogy of what i need is the following: Say e.g. you have a groub box "Sex" and two radio...
2
11920
by: James P. | last post by:
Help, I need to display radio buttons on a form. The data is from SQL table: each row in each table is displayed as a radio button. I have multiple SQL tables so I understand I need to put...
2
4936
by: Rich | last post by:
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...
11
8108
by: TokyoJ | last post by:
I run a small camp in Alaska for kids and my director is asking for a web form. Could someone please have a look and offer some advice on where I'm making mistake(s)? I'm using the RegExp function...
2
2083
by: lakepeir | last post by:
Hello, I have 4 radio buttons in a groupbox on a form. When I run the application, I would like to only select one radio button, but I can select one radio button from the first three radion...
2
2873
by: Peted | last post by:
Hi Im using c# express edition 2005 I have an MDI form, where i load multiple child forms from a dll i create, using reflection and late binding The child forms have multiple radio...
2
5876
by: dpazza | last post by:
Hi, I'm creating a quiz on using a form in VB 2005 express. I have four sets of questions and answers (labels and radio buttons) and I change between which set of questions is currently shown on...
4
185
by: Tony | last post by:
Hello! If I have three radio buttons and place these on a form without using any GroupBox I can only select one at a time. I have always thought that the purpose to use GroupBox is to force...
10
2180
by: =?Utf-8?B?UGFycm90?= | last post by:
I have 8 radio buttons on my Windows form but I can only select up to the first 4. If I click on any button beyond the 4th one and then come back into the program again the 4th button is always...
0
6964
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
7123
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
7175
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...
1
6842
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...
0
7319
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5430
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4864
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.