Home

TComponent

TComponent is the foundational class for components in the Delphi and C++Builder frameworks. Defined in the system library, it serves as the common ancestor for both visual and non-visual components and provides the core infrastructure that descendant components build upon. As the base of the component hierarchy, TComponent exposes essential functionality around lifetime management, ownership, and persistence, while leaving specialized behavior to more specific descendants such as TControl or TDataSource.

Ownership and lifetime management are central to TComponent. Components are typically created with an AOwner parameter,

Persistence and streaming are another key role. The Delphi streaming system saves and loads component properties

Notification and lifecycle state are supported through a small set of mechanisms. Components can notify others

Common non-visual descendants include data sources and timers, while visual descendants originate from TControl. TComponent thus

and
the
owner
is
responsible
for
freeing
its
owned
components
when
it
is
destroyed.
This
ownership
model
helps
manage
memory
automatically
and
allows
components
to
form
hierarchical
relationships.
to
and
from
form
and
project
files.
Because
TComponent
participates
in
this
system,
components
can
be
instantiated
and
their
properties
restored
at
design-time
and
run-time.
The
naming
and
streaming
identifiers
used
by
components
assist
the
integrated
development
environment
in
representing
the
form
hierarchy.
about
changes
or
removal,
allowing
references
to
be
cleaned
up
to
prevent
access
to
freed
objects.
TComponentState
includes
flags
used
during
the
component’s
creation,
loading,
and
destruction
phases.
provides
the
essential,
framework-wide
features
that
enable
Delphi’s
component
model
to
function
coherently.