[Overview][Types][Classes][Procedures and functions][Index] | Reference for unit 'ExtCtrls' (#lcl)

# TCustomControlBar.OnPaint

Event handler signalled to perform default drawing in the inherited Paint method.

## Declaration

Source position: extctrls.pp line 1679

`public property TCustomControlBar.OnPaint : TNotifyEvent read FOnPaint write FOnPaint;`

## Description

OnPaint is a TNotifyEvent property with the event handler signalled to draw the control bar on its Canvas. An object procedure which draws all aspects of the control must be implemented and assigned to the property.

The Sender argument provides access to properties and methods for the control instance. It must be cast to TCustomControlBar to access members for the class type.

Use the Canvas property to render the background for the control in the event handler. The values from Font and Color are already applied to the corresponding properties in Canvas.

OnPaint is signalled from the inherited Paint method, and occurs before the OnBandPaint event handler in the control is signalled.

## See also

TCustomControlBar.Paint |  | Draws the control with its image, decorations, and visible bands.
TCustomControlBar.OnBandPaint |  | Event handler signalled to render a visible band on the specified control with the specified paint options.
TCustomControl.Paint |  | Implements the default handler used to draw the control.
TCustomControl.OnPaint |  | Event handler signalled to paint the control.