Show: Delphi C++
Display Preferences

Vcl.Controls.TCustomControl

From RAD Studio API Documentation
Jump to: navigation, search

Vcl.Controls.TWinControlVcl.Controls.TControlSystem.Classes.TComponentSystem.Classes.TPersistentSystem.TObjectTCustomControl

Delphi

TCustomControl = class(TWinControl)

C++

class PASCALIMPLEMENTATION TCustomControl : public TWinControl

Properties

Type Visibility Source Unit Parent
class public
Vcl.Controls.pas
Vcl.Controls.hpp
Vcl.Controls Vcl.Controls

Description

Base class for controls that wrap Windows screen objects but perform their own rendering.

In most descendants of TWinControl, the job of drawing the control's surface belongs to the underlying Windows screen object. If a control has visible features that cannot be rendered by a Windows screen object, it requires access to a canvas object so it can do its own drawing.

TCustomControl is one of two base classes for controls that draw their own surfaces. Because TCustomControl is descended from TWinControl, instances of its descendants can receive focus and serve as containers.

Classes of controls that perform their own screen rendering and do not need the features of TWinControl should be descendants of TGraphicControl instead of TCustomControl. TGraphicControl objects can render themselves with less overhead, because they do not have underlying Windows screen objects.

TCustomControl objects have a Paint method, which is called whenever the control needs to render its image. Custom controls paint themselves using the Canvas property.

See Also

Personal tools
In Other Languages
Previous Versions
Assistance