FMX.Forms.TApplication.MainForm

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property MainForm: TCommonCustomForm read FMainForm write SetMainForm;

C++

__property TCommonCustomForm* MainForm = {read=FMainForm, write=SetMainForm};

Properties

Type Visibility Source Unit Parent
property public
FMX.Forms.pas
FMX.Forms.hpp
FMX.Forms TApplication

Description

Identifies the form in the FireMonkey application that is the main form.

The value of MainForm is the form that is the FireMonkey application's main window. The main form is the first form created in the main body of the application by a call to CreateForm. When the main form closes, the application terminates.

When you create a new FireMonkey project, Form1 automatically becomes the value of the MainForm property. To assign a different form to the MainForm property, select the form on the Project > Options > Forms dialog box at design time. MainForm cannot be modified at run time (it is read-only at run time).

Tip: By default, the form created by the first call to CreateForm in a project becomes the application's main form. Before calling CreateForm, you can create as many forms as wanted by calling their own constructor.

FMX: Before showing the MainForm, you can add a splash window. The MainForm will be shown after the initialization of the application finishes.

See Also