Sign in Join
FPDoc Onlineexperiment

TCustomLabel.Alignment property

Member of TCustomLabelprotectedIn unit StdCtrls

Horizontal text justification in the control (left- or right-justified, or centered).

Declaration

pascal
property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;

Description

Alignment is a TAlignment property which controls the horizontal justification of the text displayed in the control. The default value for the property is taLeftJustify. When a new value is assigned to the Alignment property, the Invalidate method is called to repaint the control.

Alignment (and other properties) are used in the Paint method when the text is rendered to the Canvas for the control. It is also used in UpdateSize when right alignment needs to be considered for an auto-sized or optimal-filled control.

Use the Layout property to control the vertical alignment of the text displayed in the control.

Use OptimalFill to indicate if the font height can be adjusted to fill the client area for the control.

See also

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