找个人,帮我看下错在那里?新手上路
我编写的一个计算器。。。下面是我全部的响应代码
Private Sub Label1_Click()
End Sub
Private Sub AddOptin_Click()
SymbelLabel.Caption = "+"
OutputText.Text = ""
End Sub
Private Sub DivideOption_Click()
SymbelLabel.Caption = "/"
OutputText.Text = ""
End Sub
Private Sub MisnusOption_Click()
SymbelLabel.Caption = "-"
OutputText.Text = ""
End Sub
Private Sub MultiOption_Click()
SymbelLabel.Caption = "*"
OutputText.Text = ""
End Sub
Private Sub RunCommand_Click()
Dim Number1, Number2, Result As Single
Number1 = Val(InputText1.Text)
Number2 = Val(InputText2.Text)
If AddOption.Value = True Then
Result = Number1 + Number2
End If
If Minusption.Value = True Then
Result = Number1 - Number2
End If
If MultiOption.Value = True Then
Result = Number1 * Number2
End If
If DiviOption.Value = True Then
Result = Number1 / Number2
End If
End Sub
但是运行不了。。。我点调试,它说
If AddOption.Value = True Then
Result = Number1 + Number2
End If
If Minusption.Value = True Then
Result = Number1 - Number2
End If
If MultiOption.Value = True Then
Result = Number1 * Number2
End If
If DiviOption.Value = True Then
Result = Number1 / Number2
End If
End Sub
错了。。。。麻烦你们帮我看下