帮忙看看,哪里出错了,是一个四则运算
Dim result As IntegerDim c%, c1%, c2%
Private Sub CmdOK_Click()
If Text1 <> "" Then
If Val(Text1) = result Then
L3.Caption = "真棒!"
c1 = c1 + 1
Label2.Caption = "正确题数:" & c1
Else
L3.Caption = "仔细想想,你一定会做对的!"
c2 = c2 + 1
Label3.Caption = "错误题数:" & c2
Text1.SetFocus
End If
End If
End Sub
Private Sub Form_Load()
Show
Call rand
L3 = ""
Label1 = ""
Label2 = ""
Label3 = ""
End Sub
Private Sub rand()
End Sub
Private Sub Text1_GotFocus()
Dim x1%, x2%
Randomize
x1 = Int(Rnd * 50) + 1
x2 = Int(Rnd * 50) + 1
Label7.Caption = x1
Label4.Caption = x2
Text1 = ""
Label1.Caption = "试题总数:" & c
c = c + 1
Text1.SetFocus
End Sub
Private Sub Option1_Click()
If Option1.Value Then result = x1 + x2
L5 = "+"
End Sub
Private Sub Option2_Click()
If Option1.Value Then result = x1 - x2
L5 = "-"
End Sub
Private Sub Option3_Click()
If Option1.Value Then result = x1 * x2
L5 = "*"
End Sub
Private Sub Option4_Click()
If Option1.Value Then result = x1 / x2
L5 = "/"
End Sub