Vcl.Forms.TForm.OnCreate

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnCreate: TNotifyEvent read FOnCreate write FOnCreate stored IsForm;

C++

__property OnCreate;

Properties

Type Visibility Source Unit Parent
event published
Vcl.Forms.pas
Vcl.Forms.hpp
Vcl.Forms TForm

Description

Occurs when the form is created.

Vcl.Forms.TForm.OnCreate inherits from Vcl.Forms.TCustomForm.OnCreate. All content below this line refers to Vcl.Forms.TCustomForm.OnCreate.

Occurs when the form is created.

Use OnCreate to perform special processing when the form is created and is invoked by TCustomForm's constructor. Either implement this event or override the constructor of the form; do not do both. Any objects created in the OnCreate event should be freed by the OnDestroy event.

When a form is being created and its Visible property is true, the following events occur in the order listed:

  1. OnCreate
  2. OnShow
  3. OnActivate
  4. OnPaint

Note: Use of the OnCreate event is discouraged in C++ code because it can interact badly with the form's constructor (see OldCreateOrder). It is recommended that you override the form constructor instead.

See Also

Code Examples