Help with some Visual Basic Programming. Please.

Soldato
Joined
5 Dec 2006
Posts
15,370
Sorry about that, but I honestly need some help. It's for college and teacher hasn't taught us anything, It's like a self learning thing, where you go and do your own learning while the teacher just sits there and fails you at the end of the year.

I need to hand it in tomorrow or I will fail the unit.

Basically, I've created this form:

help-please.png



Now I need it to count how many "No" were picked, then if there are 2 or less "no" then i need it to say "Optimist" in the text box. If there are more than 2 "No" I need it to say "Pessimist" in the text box.


Thanks for any help.
 
Create a variable and then give each no a value of one, then if the value of the variable = 2 or less show "Pessimist", Else If show "Optimist"
 
There's only 3 people in there.

If you can recommend some dedicated programming forum, i'd be very grateful.

Can I kick you in the nuts, lots of us spend a lot of effort replying to threads in the prog & HTML area. There might only be a view people in at any time but there's a lot of expertise in there at times.:mad:
 
Been years since I looked at VB, but on clicking the button, couldn't you just say something like

If option button 1 = true then increment counter by 1
if option button 2 = true then increment counter by 1


etc


If Counter > 2 then textbox = Whatever ?


Edit : - Damn beaten :(
 
I doubt anyone will help you with your homework, but the actual code is easy.

A quick way to do it would be on the onclick event of the button, simply check to see whether each radiobutton's checked property is true or false, and increment a local counter variable. If > 1, then set the label.text to "pessimist".
 
teacher hasn't taught us anything, It's like a self learning thing, where you go and do your own learning while the teacher just sits there and fails you at the end of the year.

I need to hand it in tomorrow or I will fail the unit.

I like that - teachers fault because you cant be bothered to make the effort - the fact that you left it to the last minute had nothing to do with it at all.

try looking at if statements with some form of boolean.

This pizza is too nice to stop eating and type to you.
 
Back
Top Bottom