有个名叫‘女爱’的网友回答过的。
我转给你把!
引用 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
我转给你把!
引用 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
我都要笑破肚皮了(~o~) 哈哈!
太幽默了!