Begins running a standard application message loop on the current thread, and makes the specified form visible.
- mainForm
- A System.Windows.Forms.Form that represents the form to make visible.
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.
The Control.Dispose(bool) method of the System.Windows.Forms.Form class will be called prior to the return of this method.