加两个编辑框就可以了。
Private Sub Command1_Click()
If Text2.Text = "+" Then
Command1.Caption = "结果" & Str(Int(Text1.Text) + Int(Text1.Text))
ElseIf Text2.Text = "-" Then
Command1.Caption = "结果" & Str(Int(Text1.Text) - Int(Text1.Text))
ElseIf Text2.Text = "*" Then
Command1.Caption = "结果" & Str(Int(Text1.Text) * Int(Text1.Text))
ElseIf Text2.Text = "/" Then
Command1.Caption = "结果" & Str(Int(Text1.Text) / Int(Text1.Text))
Else
MsgBox "运算符号输入错误!", 64, "提示!"
Exit Sub
End If
End Sub
温馨提示:内容为网友见解,仅供参考