Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

Beginner Help

$
0
0
Hi

I'm not sure if im doing this the right way

for example, i ask the user 2 questions using combo boxes
Private Sub ComboBoxConQ1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBoxConQ2.SelectedIndexChanged
If ComboBoxConQ1.SelectedItem = "Yes" Then Q1A.Text = "LowRisk"
If ComboBoxConQ1.SelectedItem = "No" Then Q1A.Text = "HighRisk"
End Sub

Private Sub ComboBoxConQ2_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBoxConQ2.SelectedIndexChanged
If ComboBoxConQ2.SelectedItem = "Yes" Then Q2A.Text = "LowRisk"
If ComboBoxConQ2.SelectedItem = "No" Then Q2A.Text = "HighRisk"
End Sub

Then i have a button which i need to work out the score

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click


Dim LowRisk As Integer
Dim MediumRisk As Integer
Dim HighRisk As Integer
Dim score As Integer


LowRisk = 1
MediumRisk = 5
HighRisk = 10

score = ComboBoxConQ1.SelectedText + ComboBoxConQ2.SelectedText

LabelRSR.Text = score

Any hints and tips on how this should be done.

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>