Alright here is my problem...
I can write a bunch of elseif statements to check if a radiobutton is checked etc....
But i just learned the Case statement and think this is a much more elegant way to do things.
I am checking to see which radiobutton is checked in my groupbox and then to check if the user input was over a certain number.
Basically checking to see which month it is and if the user entered an impossible number for the maximum number of hours in that month.
Here is some pseudocode: I just don't know how to get VB to check a certain list of radiobuttons in a groupbox... this is for a windows application btw..
Very new with this syntax stuff... i been searching for ever to find the solution, but if it comes down to it, i'll just use a bunch of if statements.
Help please or a point to a reference i can read? Thanks.
I can write a bunch of elseif statements to check if a radiobutton is checked etc....
But i just learned the Case statement and think this is a much more elegant way to do things.
I am checking to see which radiobutton is checked in my groupbox and then to check if the user input was over a certain number.
Basically checking to see which month it is and if the user entered an impossible number for the maximum number of hours in that month.
Here is some pseudocode: I just don't know how to get VB to check a certain list of radiobuttons in a groupbox... this is for a windows application btw..
Very new with this syntax stuff... i been searching for ever to find the solution, but if it comes down to it, i'll just use a bunch of if statements.
Help please or a point to a reference i can read? Thanks.
Code:
Select Case radiobuttongroup.checked
Case radBtn1, radBtn3, radBtn5, radBtn7, radBtn7, radBtn10, radBtn12
if Cint(userinput.text) > 744 then
messagebox.show("To many hours")
endif
Case radBtn2
if Cint(userinput.text) > 672 then
messagebox.show("To many hours")
endif
Case radBtn4, radBtn6, radBtn9, radBtn11
if Cint(userinput.text) > 720 then
messagebox.show("To many Hours")
endif