Skip to main content

TcxFontPreview.Alignment Property

Defines the alignment of the preview text within the preview area.

Declaration

property Alignment: TAlignment read; write; default taCenter;

Property Value

Type Default
TAlignment taCenter

Remarks

The Alignment property specifies the alignment of the preview text displayed within the font name combo box. You may display the text on the left, right or centered. The alignment property can be read and modified at design and at run-time. The following code changes preview text alignment:

//...
with cxFontNameComboBox1.Properties.FontPreview do
begin
  if Alignment <> taCenter then
    Alignment := taCenter;
end;
//...

The following screenshots show different alignment settings:

Property’s Value Meaning Effect
taLeft Preview text is left aligned.
taCenter Preview text is centered.
taRight Preview text is right aligned.

The default value of the Alignment property is taCenter.

See Also