引用 Microsoft Script Control 1.0 (也可用控件)
objects: Form1、Command1、Text1
Code:
Private Sub Form_Load()
Text1.Text = "1+2+sqr(3)"
End Sub
Private Sub Command1_Click()
Dim s As New MSScriptControl.ScriptControl
s.Language = "VBScript"
s.AddObject "Form1", Me
s.AddCode "a=" & Trim(Text1.Text)
s.ExecuteStatement "Form1.Caption = a"
End Sub
objects: Form1、Command1、Text1
Code:
Private Sub Form_Load()
Text1.Text = "1+2+sqr(3)"
End Sub
Private Sub Command1_Click()
Dim s As New MSScriptControl.ScriptControl
s.Language = "VBScript"
s.AddObject "Form1", Me
s.AddCode "a=" & Trim(Text1.Text)
s.ExecuteStatement "Form1.Caption = a"
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货