所要求的程序已经完成,取余数用%作运算符。请采纳:
Private Sub Command1_Click()
x = Val(Text1.Text)
op = Text2.Text
y = Val(Text3.Text)
If y = 0 And (op = "%" Or op = "/") Then
MsgBox ("除法运算中除数不能为0!")
Exit Sub
End If
Select Case op
Case "+":
MsgBox (x & " + " & y & " = " & x + y)
Case "-":
MsgBox (x & " - " & y & " = " & x - y)
Case "*":
MsgBox (x & " * " & y & " = " & x * y)
Case "%":
MsgBox (x & " % " & y & " = " & x Mod y)
Case "/":
MsgBox (x & " / " & y & " = " & x / y)
Case Else
MsgBox ("未识别的运算符!")
End Select
End Sub