473,609 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
+ 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 5551
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*******@symp atico.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*******@symp atico.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
1938
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 buttons "Male" and "Female". When you recall the form to edit the information of the person to change from male to female :) what is the binding i have to make. From
2
11953
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 them each in a GroupBox. All the examples I saw from the books or from the web show me how to add static radio buttons at design, or dynamically at run time but with fixed radio buttons (like from an array). I need to create radio buttons based...
2
4946
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 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...
11
8155
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 to validate 3 types of fields: text, radio button, dropdown menu. but the code doesn't validate. After 2 days, it's time I asked for guidence. Criteria: Text: only alphabet, no numerals, allowed Radio: one must be selected, Dropdown: an option...
2
2087
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 buttons and the last radio button. It appears that the last radio button is not grouped with the others although I have them all in the same groupbox. Please help. Thanks.
2
2882
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 buttons in a groupbox, and have the appearence set to button
2
5886
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 the form by changing the visible state of the radio buttons and labels utilising back and next buttons. E.g. Next button makes current radio buttons and labels invisible and
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 that only one radio button can be selected at a time. So now to my question: What is the main purpose to use GroupBox ?
10
2197
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 checked instead of the 5th or 6th etc. I followed the logic thru the debugger and can see where the 5th button is progammatically checked but the window shows the 4th checked instead. Does anyone have a clue as to what's going on here? All of the...
0
8133
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8224
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7013
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6062
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5517
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4026
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1676
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1393
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.