[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Forms' (#lcl)

# TApplication.MainForm

Contains the main form for the application.

## Declaration

Source position: forms.pp line 1740

`public property TApplication.MainForm : TForm read FMainForm;`

## Description

MainForm is a read-only TForm property which contains the form that is the main or primary form for the application.

The value in MainForm is assigned when the first form is created using the CreateForm method and the FormStyle for the form contains a value other than fsSplash.

The form instance in MainForm is displayed when the Run method is called to start the message processing loop for the application.

The application is terminated when this form is closed.

## See also

TApplication.CreateForm |  | Creates a Form or component owned by the Application instance.
TApplication.Run |  | Loads the form and passes control to the event loop for the application.
TCustomForm.FormStyle |  | Indicates the style for the form.
TForm |  | Implements a form used in an LCL application.