FMX.Objects.TPaintBox.Create
Delphi
constructor Create(AOwner: TComponent); override;
C++
__fastcall virtual TPaintBox(System::Classes::TComponent* AOwner);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
constructor | public | FMX.Objects.pas FMX.Objects.hpp |
FMX.Objects | TPaintBox |
Description
Allocates memory and constructs a safely initialized instance of a component.
Allocates memory and constructs a safely initialized instance of a component.
Allocates memory and constructs a safely initialized instance of a component.
FMX.Objects.TPaintBox.Create inherits from System.Classes.TComponent.Create. All content below this line refers to System.Classes.TComponent.Create.
Allocates memory and constructs a safely initialized instance of a component.
All objects have a Create method that constructs the object. TComponent redefines Create so that, for components, Create also:
- Establishes the relationship of a component and its Owner, as indicated by the
AOwner
parameter.
- Sets the ComponentStyle property to
csInheritable
, meaning that the component can be inherited by a descendent form type.
It is not necessary to explicitly create components added in the Form Designer. These components are created automatically when the application is run, and they are destroyed when the application is closed.
For components created programmatically, that is, not created in the Form Designer, call Create and pass in an owner component as the AOwner
parameter. The owner disposes of the component when it is destroyed. If the component is not owned, then use Free when it needs to be destroyed.
Self
as the Owner parameter, consider what Self
references. If a component creates another component in one of its methods, then Self
refers to the first component and not the component being created, which is then owned by the first component.