vb编写简单四则运算
PrivateSubCommand1_Click()DimaAsStringDimbAsStringDimcAsStringa=Text1.Textb=Text2.Tex...
Private Sub Command1_Click()
Dim a As String
Dim b As String
Dim c As String
a = Text1.Text
b = Text2.Text
c = a + b
MsgBox "结果是" & c
End Sub
为什么输入 1 和2 时 结果是12?如何改正? 展开
Dim a As String
Dim b As String
Dim c As String
a = Text1.Text
b = Text2.Text
c = a + b
MsgBox "结果是" & c
End Sub
为什么输入 1 和2 时 结果是12?如何改正? 展开
展开全部
vb写的四则运算如下:
Private Sub Command1_Click()
On Error GoTo err
Dim s As Object
Dim Bds As String '表达式
Set s = CreateObject("MSScriptControl.ScriptControl")
s.Language = "VBScript"
Bds = Text1
Text2 = s.Eval(Bds)
Exit Sub
err:
Text2 = err.Description
End Sub
Private Sub Command1_Click()
On Error GoTo err
Dim s As Object
Dim Bds As String '表达式
Set s = CreateObject("MSScriptControl.ScriptControl")
s.Language = "VBScript"
Bds = Text1
Text2 = s.Eval(Bds)
Exit Sub
err:
Text2 = err.Description
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
楼上的说对了,不再重复!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询