Difference between revisions of "TApplication"

From Lazarus wiki
Line 18: Line 18:
<tt>TMyForm</tt> is assumed a descendant of [[TForm]] and defined in <tt>uMyForm.pas</tt>
<tt>TMyForm</tt> is assumed a descendant of [[TForm]] and defined in <tt>uMyForm.pas</tt>
==see also==
* [https://lazarus-ccr.sourceforge.io/docs/lcl/forms/tapplication.html TApplication at lazarus-ccr]

Revision as of 17:17, 19 November 2020

TApplication (with instance Application) that is available in every Lazarus program.

Unlike forms, and components on the forms a (single) instance of TApplication is created before any user line of code. In a .lpr file (a pascal file containing the keyword 'program' ) the Application-variable is used to create the applications form(s):

program pMyTest;
  Forms, uMyForm

{$R *.res}

  Application.CreateForm( TMyForm, MyForm );

TMyForm is assumed a descendant of TForm and defined in uMyForm.pas

see also