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

# TCustomPanel.Paint

Paints the panel including the bevels and caption defined for the control.

## Declaration

Source position: extctrls.pp line 1150

`protected procedure TCustomPanel.Paint; override;`

## Description

Paint is an overridden procedure which draws the panel including the bevels and caption defined for the control. Paint calls GetClientRect to get the rectangle used to draw the control. PaintBevel is called to draw both the inner and outer bevels for the control (when used).

When Caption contains a String value (other than an empty string), the Canvas for the control is used to render the text. Values in the Alignment, VerticalAlignment, UseRightToLeft, and WordWrap properties are applied to the Canvas properties as needed. The font color on the canvas is updated for the Enabled state in the control and use of theme services. The TextRect method in Canvas is called to output the Caption text to the client rectangle for the control.

Paint calls the inherited method prior to exit to signal the OnPaint event handler (when assigned).

## See also

TCustomControl.Paint |  | Implements the default handler used to draw the control.