All,
Let me first say that I don't consider myself to be a VB programmer/scripter. I'm playing around with a small demo for a presentation.
I have a combo box with no and yes values. If no is selected, no points are added to a label showing a total. If I select yes, 5 points are added and the label changes to 5. If I go back to no, it does not revert to 0. Can someone help me out with my logic?
Thanks,
Monte
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedIndex = 0 Then
total = total + 0
ElseIf ComboBox1.SelectedIndex = 1 Then
total = total + 5
End If
Label104.Text = total
Label16.Text = total
Label14.Text = total
End Sub
Let me first say that I don't consider myself to be a VB programmer/scripter. I'm playing around with a small demo for a presentation.
I have a combo box with no and yes values. If no is selected, no points are added to a label showing a total. If I select yes, 5 points are added and the label changes to 5. If I go back to no, it does not revert to 0. Can someone help me out with my logic?
Thanks,
Monte
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedIndex = 0 Then
total = total + 0
ElseIf ComboBox1.SelectedIndex = 1 Then
total = total + 5
End If
Label104.Text = total
Label16.Text = total
Label14.Text = total
End Sub