Vcl.Forms.TCustomForm.OnCreate
Delphi
property OnCreate: TNotifyEvent read FOnCreate write FOnCreate stored IsForm;
C++
__property System::Classes::TNotifyEvent OnCreate = {read=FOnCreate, write=FOnCreate, stored=IsForm};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | protected | Vcl.Forms.pas Vcl.Forms.hpp |
Vcl.Forms | TCustomForm |
Description
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:
- OnCreate
- OnShow
- OnActivate
- 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