Vcl.Forms.TForm.OnCreate
Delphi
property OnCreate;
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:
- 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