编写简易计算器时,没弹出除数不能为0的提示框,什么问题?代码附上
Private Sub Command1_Click()Text3.Text = Val(Text1.Text) + Val(Text2.Text)
End Sub
Private Sub Command2_Click()
Label1 = "-"
Text3.Text = Val(Text1.Text) - Val(Text2.Text)
End Sub
Private Sub Command3_Click()
Label1 = "*"
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub
Private Sub Command4_Click()
Label1 = "/"
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
If Val(Text2.Text) = "0" Then
MsgBox "除数不能为0"
End If
End Sub