Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 1.22 KB

Application.md

File metadata and controls

52 lines (34 loc) · 1.22 KB
title Application Class

Application Class

Provides static methods and properties to manage an application, such as methods to start and stop an application.

public static class Application 

Methods

Exit ()Exits the application.
Run (Form)Begins running a standard application message loop on the current thread, and makes the specified form visible.
Run (ICloseable)Runs the application's main loop until the is closed.
RunOnUIThread (Action)Performs the desired Action on the UI thread.

Events

OnExitRaised when the application is exiting.

Examples

The most common use of this class is to start running a Modern.Forms application using a specified Form.

public static void Main (string[] args)
{
    var form = new Form ();

    form.Controls.Add (new Button ());

    Application.Run (form);
}

This will display the Form to the user. When the Form is closed, the application will automatically terminate.

Remarks