validate radio button in groupbox

  • Thread starter Thread starter K Forester
  • Start date Start date
K

K Forester

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
 
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
 
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
 
Back
Top