NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Application.Run (Form)

Begins running a standard application message loop on the current thread, and makes the specified form visible.

[Visual Basic]
Overloads Public Shared Sub Run( _
   ByVal mainForm As Form _
)
[C#]
public static void Run(
   Form mainForm
);
[C++]
public: static void Run(
   Form* mainForm
);
[JScript]
public static function Run(
   mainForm : Form
);

Parameters

mainForm
A Form that represents the form to make visible.

Exceptions

Exception Type Condition
InvalidOperationException A main message loop is already running on the current thread.

Remarks

Typically, the main function of an application calls this method and passes it to the main window of the application.

This method adds an event-handling method to mainForm for the System.WinForms.Form.Closed event. The event-handling method will call ExitThread to clean up the application.

Requirements

NGWS Runtime Security:

UIPermission You must have the System.security.Permissions.UIPermission for AllWindows to set this method.

See Also

Application Class | Application Members | System.WinForms Namespace | Application.Run Overload List | Exit | ExitThread | DoEvents