HighTechTalks DotNet Forums  

Using VSA with WinForms

Dotnet VSA microsoft.public.dotnet.vsa


Discuss Using VSA with WinForms in the Dotnet VSA forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Using VSA with WinForms - 06-09-2004 , 12:22 PM






I've a Winforms application that I want to add some
scripting capabilities to, using VSA.

I've a running app and can invoke methods in my script,
but I want the user to define event handlers for
controls on the form.

The way I use is to predefine event handlers in my
code and invoke the methode in the script then:

Button b = new Button();
b.Name = "ScriptButton";
b.Click += new EventHandler(script_Event);

private void script_Event(object sender, EventArgs e)
{
// look for a method "ScriptButton_Click" and invoke
}

This works, but it seems really complicated. The Script
I use does contain definitions like

Private Sub ScriptButton_Click(sender As Object, e As EventArgs) _
Handles Click
' Do something on Click
End Sub

And the Button is added as Object.

If I Run() the VsaEngine, nothing happens (obviously, cause
I invoke nothing).

Question:
How can I use the Scriptengine as event handler vor an
existing form? How can I interact betwenn the form and the
scripting code? Is there any way to operate the script as
part of the form, e.g. invoke ShowDialog() of my form from
within the script and deal with the form as I can from my
main app?

Thanks for any idea

Joerg

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.