System.Windows.Forms.Application.Run Method

Begins running a standard application message loop on the current thread, without a form.

Syntax

public static void Run ()

Remarks

In a Win32-based or Windows Forms application, a message loop is a routine in code that processes user events, such as mouse clicks and keyboard strokes. Every running Windows-based application requires an active message loop, called the main message loop. When the main message loop is closed, the application exits. In Windows Forms, this loop is closed when the Application.Exit method is called, or when the Application.ExitThread method is called on the thread that is running the main message loop.

Most Windows Forms developers will not need to use this version of the method. You should use the Application.Run(Form) overload to start an application with a main form, so that the application terminates when the main form is closed. For all other situations, use the Application.Run(ApplicationContext) overload, which supports supplying an System.Windows.Forms.ApplicationContext object for better control over the lifetime of the application.

Requirements

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