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

# TCustomLabel.DoDrawText

Performs actions needed to draw the text for the label.

## Declaration

Source position: stdctrls.pp line 1570

`protected procedure TCustomLabel.DoDrawText(`
`var Rect: TRect;`
`Flags: LongInt`
`); virtual;`

## Arguments

`Rect` |  | Text rectangle used to draw the label text.
`Flags` |  | DrawText flags used to render the text.

## Description

DoDrawText performs action needed to draw the text for the label.

The GetLabelText method is called to get the text value drawn in the method.

The Font color may be temporarily changed when when the Enabled property is False. If themes are enabled, the Font color is set to clGrayText. When themes are not enabled, the Font color is set to clBtnHighlight. The original Font color is restored prior to exiting the method.

DoDrawText calls the DrawText routine to draw the text on the Canvas using the text rectangle and flags passed as arguments. DrawText is called a second time to render the shadow for the label text when themes are not enabled. The shadow text uses the color clBtnShadow.

DoDrawText is called from the Paint method.