im writing a app that u write some vbscript or javascript or html
and u can run it

does anyone know how to run any of these languages from in vb

Hi,

Add a "MSScriptControl" to ur project.
Rename it as MyScript. Add a TextBox and a Command button on the form

and use this code to run it:

Private Sub Form_Load()
MyScript.Language = "VBScript"
MyScript.AddObject "Form1", Form1
MyScript.AllowUI = True
Text1 = "a = Ucase(InputBox(""Enter Ur Name""))" & vbCrLf & _
"MsgBox ""Thanks For using MS ScriptControl "" & a" _
& "'Change the form" & vbCrLf & _
"Form1.BackColor = vbBlue"
End Sub
 
 
Private Sub Command1_Click()
On Error GoTo Lerr
MyScript.AddCode Text1
Exit Sub
Lerr:
MsgBox Err.Number & Err.Description, vbCritical, "error"
Err.Clear
End Sub

Regards
Veena

Hi,

Goto menu :

Projects>> Components>>
Search "Microsoft Script Control 1.0"
Check this and Click OK.
Now u have it in ur ToolBox at the end..
From there add to the form and use the Above Code. u can change the Scrpt code later..

Regards
Veena

Hi,

follow the above procedure. did u Check it and Clicked "OK"..?
it will add in toolbox, but it will be in the end, if u have many controls on the toolbox, Increase the width of toolbox and check..
it is a small icon resembling VBProject icon..


Regards
Veena

Hi,

u should have told that before, My code is for VB6 and this is VB6 Forum. Post ur code in VB.net forum..
anyway i will check with vb.net and let u know..

Regards
Veena

This article has been dead for over six months. Start a new discussion instead.