System.Windows.Forms.Application.Run Method

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

Syntax

public static void Run (Form mainForm)

Parameters

mainForm
A System.Windows.Forms.Form that represents the form to make visible.

Remarks

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

This method adds an event handler to the mainForm parameter for the Form.Closed event. The event handler calls Application.ExitThread to clean up the application.

Note:

The Control.Dispose(bool) method of the System.Windows.Forms.Form class will be called prior to the return of this method.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0