Sign in Join
FPDoc Onlineexperiment

TCustomControl.Canvas property

Member of TCustomControlpublicIn unit Controls

The drawing surface for the control.

Declaration

pascal
property Canvas: TCanvas read FCanvas write FCanvas;

Description

Canvas is a TCanvas property which contains the drawing surface for the control. Resources for the property are allocated in the constructor for the class instance. A TControlCanvas descendant is created and assigned to the member for the property. The Handle for the Canvas is updated when PaintWindow is called for a specific device context.

Changing values in the Font or Color properties causes settings in Canvas to be updated. A new value assigned to Font is also assigned to the Canvas in the control, and includes the PixelsPerInch setting for the Font. A new value assigned to Color is applied to the Brush in Canvas. A value assigned to BorderStyle must be handled in the routine assigned to the OnPaint event handler.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.