Classes.TComponent

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From Classes.pas

TComponent = class(TPersistent)


Unit: Classes

Type: class

Inherited Class Members: Classes.TComponent Members

Class Properties: Classes.TComponent Properties

Class Methods: Classes.TComponent Methods

Class Fields: Classes.TComponent Fields

Class Constructors & Destructors: Classes.TComponent Constructors

C++ Information

From Classes.hpp

TComponent = class(TPersistent)


Unit: Classes

Type: class

Inherited Class Members: Classes.TComponent Members

Class Properties: Classes.TComponent Properties

Class Methods: Classes.TComponent Methods

Class Fields: Classes.TComponent Fields

Class Constructors & Destructors: Classes.TComponent Constructors

Description

TComponent is the common ancestor of all component classes.


TComponent is the base class for all components. TComponent implements the following features:

  • IDE integration. The ability to appear on an IDE palette and be manipulated in a form designer.
  • Ownership. The ability to manage other components. If component A owns component B, then A is responsible for destroying B when A is destroyed.
  • Streaming and filing. Enhancements of the persistence features inherited from TPersistent.
  • COM support. Components can be converted into ActiveX controls or other COM objects using wizards provided with Windows products. Components can serve as wrappers for COM objects.
Note: COM features are present in all implementations of TComponent, including those provided with Linux and Macintosh development tools. However, these features are only useful in Windows applications, and are marked in this documentation as "Windows only". Do not use these features in cross-platform applications.

TComponent does not provide any user interface or display features. These features are provided by two classes that directly descend from TComponent.

TControl, in the UControls unit, is the base class for "visual" components in cross-platform applications.

TControl, in the Controls unit, is the base class for "visual" components in Windows-only applications.

Note: The Controls unit and other Windows-specific units are not provided with Linux or Macintosh development tools.

Components that can be visible at run time are sometimes called "visual components". Other components, which are never visible at run time, are sometimes called "nonvisual components". However it is more common to refer to "visual components" as "controls" and "nonvisual components" simply as "components."

Do not create instances of TComponent. Use TComponent as a base class when declaring nonvisual components that can appear on the component palette and be used in the form designer. Properties and methods of TComponent provide basic behavior that descendent classes inherit as well as behavior that components can override to customize their behavior.

See Also

Personal tools
Translations
Newest Version