vb编程 一个简单的计算 代码如下
a=Val(Text1.Text)b=Text2.Textc=Val(Text3.Text)Ifa=""Orc=""Orb=""ThenMsgBox"请输入数字计算,不能...
a = Val(Text1.Text) b = Text2.Text c = Val(Text3.Text) If a = "" Or c = "" Or b = "" Then MsgBox "请输入数字计算,不能为空" If b <> "+" Or b <> "-" Or b <> "*" Or b <> "/" Then MsgBox ("请输入正确的运算符") If b = "+" Then Text4.Text = a + c If b = "-" Then Text4.Text = a - c If b = "*" Then Text4.Text = a * c If b = "/" Then If c = 0 Then c = MsgBox("除数不能为零") Else Text4.Text = a / c End If End If 不知道哪里错了,各位老师帮忙纠正下
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询