|
-
Dec 24th, 2012, 01:01 AM
#1
Thread Starter
New Member
Radio Buttons and Group box --- code not SHOWING result in appropiate place or at all
Hi all
I am not sure if this is a problem - or if i am on the right path or not even close. When i run the program it loads, I do not get any errors but i can NOT get the resultLabel to show the addition Math or answer
the code below: (its not really HTML code....)
Anyhelp would be greatly appreciated
I am using Visual Basic Express 2008
HTML Code:
'Declares Local Variables
Dim num1Decimal As Decimal
Dim num2Decimal As Decimal
Dim resultLabel As Decimal
'Place the Data in the Variables
num1Decimal = Val(num1.Text)
num2Decimal = Val(num1.Text)
'This is the information from the radiobuttons
' Create and initialize a GroupBox and a Button control.
Dim spinGroupBox As New GroupBox
Dim resultADecimal As Decimal
Dim spin1b As Decimal
Select Case True
Case spin1RadioButton.Checked
spin1b = 0.095
Case spin2RadioButton.Checked
spin1b = 0.085
Case spin3RadioButton.Checked
spin1b = 0.08
Case spin4RadioButton.Checked
spin1b = 0.08
Case spin5RadioButton.Checked
spin1b = 0.08
End Select
resultADecimal = spin1b
' Create and initialize a GroupBox and a Button control.
Dim windGroupBox As New GroupBox
Dim wind1b As Decimal
Dim resultBDecimal As Decimal
Select Case True
Case upRadioButton.Checked
wind1b = 0.095
Case ULRadioButton.Checked
wind1b = 0.085
Case urRadioButton.Checked
wind1b = 0.075
Case downRadioButton.Checked
wind1b = 0.07
Case dlRadioButton.Checked
wind1b = 0.065
Case drRadioButton.Checked
wind1b = 0.06
Case leftRadioButton.Checked
wind1b = 0.055
Case rightRadioButton.Checked
wind1b = 0.05
End Select
resultBDecimal = wind1b
' Create and initialize a GroupBox and a Button control.
Dim locationGroupBox As New GroupBox
Dim location1b As Decimal
Dim resultCDecimal As Decimal
Select Case True
Case fairwayRadioButton.Checked
location1b = 0.095
Case firstCutRadioButton.Checked
location1b = 0.085
Case secondCutRadioButton.Checked
location1b = 0.075
Case deepRadioButton.Checked
location1b = 0.07
Case sandRadioButton.Checked
location1b = 0.065
Case weedsRadioButton.Checked
location1b = 0.06
Case mulchRadioButton.Checked
location1b = 0.055
End Select
resultCDecimal = location1b
' Create and initialize a GroupBox and a Button control.
Dim swingGroupBox As New GroupBox
Dim swing1b As Decimal
Dim resultDDecimal As Decimal
Select Case True
Case fullRadioButton.Checked
swing1b = 0.095
Case pitchRadioButton.Checked
swing1b = 0.085
Case chipRadioButton.Checked
swing1b = 0.075
Case flopRadioButton.Checked
swing1b = 0.07
Case punchRadioButton.Checked
swing1b = 0.065
End Select
resultDDecimal = swing1b
' Create and initialize a GroupBox and a Button control.
Dim lieGroupBox As New GroupBox
Dim lie1b As Decimal
Dim resultEDecimal As Decimal
Select Case True
Case lie1RadioButton.Checked
lie1b = 0.095
Case lie2RadioButton.Checked
lie1b = 0.085
Case lie3RadioButton.Checked
lie1b = 0.075
Case lie4RadioButton.Checked
lie1b = 0.07
Case lie5RadioButton.Checked
lie1b = 0.065
Case lie6RadioButton.Checked
lie1b = 0.06
Case lie7RadioButton.Checked
lie1b = 0.055
Case lie8RadioButton.Checked
lie1b = 0.05
End Select
resultEDecimal = lie1b
' Calculate and Display the Yards to Hole needed.
resultLabel = num1Decimal + (num1Decimal * resultADecimal) + (num2Decimal * resultBDecimal) + (num1Decimal * resultCDecimal) + (num1Decimal * resultDDecimal) + (num1Decimal * resultEDecimal)
-
Dec 24th, 2012, 02:38 AM
#2
Re: Radio Buttons and Group box --- code not SHOWING result in appropiate place or at
The best thing to do is to place a breakpoint at the beginning of this sub. When you run it, the IDE will take over and show the code when you reach the line where you put the breakpoint. You can then interrogate the value of variables by hovering the cursor over them. Step through the code line by line and see if the values of the variables are what you expect them to be. That will tell you where the problem lies.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|