Private Sub Button1_Click(ByVal sender As SystemObject, ByVal e As SystemEventArgs) Handles Button1Click
Dim a, b, d As Single
Dim c As Char
a = Val(TextBox1Text)
b = Val(TextBox3Text)
c = Trim(TextBox2Text)
If c = "+" Then
d = a + b
ElseIf c = "-" Then
d = a - b
ElseIf c = "" Then
d = a b
ElseIf c = "/" Then
If b = 0 Then
MsgBox("分母为0", "sy3 - 6")
exit sub
End If
d = a / b
End If
TextBox4Text = d
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)