Unit 'Controls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]


The drawing surface for the control.


Source position: controls.pp line 2422

public property TCustomControl.Canvas : TCanvas
  read FCanvas
  write FCanvas;


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



The drawing surface for the control.



Event handler signalled to paint the control.



Indicates the border style displayed around the control.



The font to be used for text display in this control.



Base class which provides a canvas property used in graphic controls.



Implements a drawing surface for a visual control or bitmap image.

CT Web help

CodeTyphon Studio