[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Controls' (#lcl)

TCustomControl

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

The base class for windowed controls which paint themselves.

Declaration

Source position: controls.pp line 2307

type TCustomControl = class(TWinControl) end;

protected

  class procedure WSRegisterClass; override;

  

Registers this component class with the current WidgetSet.

  procedure WMPaint(); message;

  

Event handler for paint messages.

  procedure DestroyWnd; override;

  

Destroys the interface object (widget).

  procedure PaintWindow(); override;

  

Paints an clipped part (child control) of the DC.

  procedure FontChanged(); override;

  

Handles changes of the Font property.

  procedure SetColor(); override;

  procedure Paint; virtual;

  

Override this method in your derived class with your own paint handler.

public

  constructor Create(); override;

  destructor Destroy; override;

  property Canvas: TCanvas; [rw]

  

The drawing surface for the control, see TCanvas for details.

  property BorderStyle: TBorderStyle;

  

Allows to show a border (line) around the control,

  property OnPaint: TNotifyEvent; [rw]

  

Supply your own OnPaint handler for painting the control.

Inheritance

TCustomControl

  

The base class for windowed controls which paint themselves.

|

TWinControl

  

The base class for controls which can contain other (child) controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components associated with widgets.

|

TComponent

?

TObject

Description

In contrast to TGraphicControl, a TCustomControl can accept keyboard input (get the Focus) and can have child controls.

Override the Paint method or supply your own OnPaint handler, to do the actual drawing of the control.

See also

TWinControl

  

The base class for controls which can contain other (child) controls.

TGraphicControl

  

TGraphicControl is the base class for all lightweight controls.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.