Saturday, February 6, 2010

visual basic program coding for using option buttons

Dim tot As Integer

Private Sub Command1_Click()
MsgBox " UR SCORE = " & tot
End Sub


Private Sub Option1_Click()
If Option1.Value = True Then
tot = tot + 1
Else
tot = tot - 1
Option2.Enabled = False
Option3.Enabled = False
Option4.Enabled = False
Option5.Enabled = False
End If
End Sub

Private Sub Option11_Click()
If Option11.Value = True Then
tot = tot + 1
Else
tot = tot - 1
Option12.Enabled = False
Option13.Enabled = False
Option14.Enabled = False
Option15.Enabled = False
End If
End Sub

Private Sub Option17_Click()
If Option17.Value = True Then
tot = tot + 1
Else
tot = tot - 1
Option16.Enabled = False
Option18.Enabled = False
Option19.Enabled = False
Option20.Enabled = False
End If
End Sub

Private Sub Option21_Click()
If Option21.Value = True Then
tot = tot + 1
Else
tot = tot - 1
Option22.Enabled = False
Option23.Enabled = False
Option24.Enabled = False
Option25.Enabled = False
End If
End Sub

Private Sub Option27_Click()
If Option27.Value = True Then
tot = tot + 1
Else
tot = tot - 1
Option26.Enabled = False
Option28.Enabled = False
Option29.Enabled = False
Option30.Enabled = False
End If
End Sub

Private Sub Option31_Click()
If Option31.Value = True Then
tot = tot + 1
Else
tot = tot - 1
Option32.Enabled = False
Option33.Enabled = False
Option34.Enabled = False
Option35.Enabled = False
End If
End Sub

Private Sub Option37_Click()
If Option37.Value = True Then
tot = tot + 1
Else
tot = tot - 1
Option36.Enabled = False
Option38.Enabled = False
Option39.Enabled = False
Option40.Enabled = False
End If
End Sub



Private Sub Option41_Click()
If Option41.Value = True Then
tot = tot + 1
Else
tot = tot - 1
Option42.Enabled = False
Option43.Enabled = False
Option44.Enabled = False
Option45.Enabled = False
End If
End Sub

Private Sub Option48_Click()
If Option48.Value = True Then
tot = tot + 1
Else
tot = tot - 1
Option46.Enabled = False
Option47.Enabled = False
Option49.Enabled = False
Option50.Enabled = False
End If
End Sub

Private Sub Option7_Click()
If Option7.Value = True Then
tot = tot + 1
Else
tot = tot - 1
Option6.Enabled = False
Option8.Enabled = False
Option9.Enabled = False
Option10.Enabled = False
End If
End Sub

No comments:

Post a Comment