2个回答
展开全部
添加引用Microsoft Script Control
Imports MSScriptControl
Public Class Form1
Dim ScripObj As New MSScriptControl.ScriptControl
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ScripObj.Language = "VBScript"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
ScripObj.AddCode(RichTextBox1.Text)
ScripObj.Run("a", TextBox1)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
'在文本框中输入的函数
sub a(obj)
dim a ,b
a=40:b=30
if a>b then
obj.text="A>B"
else
obj.text="A<B"
end if
end sub
2013-10-19
展开全部
我也在关注
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询