Dim op As String
Private Sub Command1_Click()
a = Val(Text1)
b = Val(Text2)
If op = "+" Then c = a + b
If op = "-" Then c = a - b
If op = "*" Then c = a * b
If op = "/" Then c = a / b
Text3 = c
End Sub
Private Sub Form_Load()
Text1 = ""
Text2 = ""
Text3 = ""
Label1(0) = "+"
Label1(1) = "-"
Label1(2) = "*"
Label1(3) = "/"
Label2 = ""
Command1.Caption = "="
Frame1.Caption = "运算符"
End Sub
Private Sub Option1_Click(Index As Integer)
If Index = 0 Then op = "+"
If Index = 1 Then op = "-"
If Index = 2 Then op = "*"
If Index = 3 Then op = "/"
Label2.Caption = op
End Sub
蟹蟹😃
没有处理bug,自行完善吧
蟹蟹