vb编辑的假发计算器,有点问题无法执行check,Help!!

来源:百度知道 编辑:UC知道 时间:2024/05/17 02:36:21
Private Sub Command1_Click()
Text3.Text = " "
Randomize
Text1.Text = Val(Int(Rnd * 101))
Text2.Text = Val(Int(Rnd * 101))
Command2.SetFocus
Text3.Text = Val(InputBox("input right result"))
End Sub
Private Sub Command2_Click()
If Val(Text3.Text) = Val(Text1.Text) + Val(Text2.Text) Then
label1.Caption = "Very Good" //无法执行
Else
label1.Caption = "wrong,again"//无法执行
End If

End Sub
Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Command1.Caption = "start"
Command2.Caption = "check"
Command3.Caption = "result"
End Sub

上面是一段加法计算核对的程式,但是判断句以下就无法执行,请各位帮忙,Thanks!

你这个程序我看了半天,应该没有错误,后来运行了下,可以通过

Private Sub Command1_Click()
Text3.Text = ""
Randomize
Text1.Text = Val(Int(Rnd * 101))
Text2.Text = Val(Int(Rnd * 101))
Command2.SetFocus
Text3.Text = Val(InputBox("input right result"))
End Sub

Private Sub Command2_Click()
If Val(Text3.Text) = Val(Text1.Text) + Val(Text2.Text) Then
Label1.Caption = "Very Good"
Else
Label1.Caption = "wrong,again"
End If
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Command1.Caption = "start"
Command2.Caption = "check"
Command3.Caption = "result"
End Sub
================
如果还不能通过,你把错误提示写出来