Nasreddine Galfout
Nasreddine Galfout

Reputation: 2591

How to left/right align lines in rich edit (Delphi)?

Is there a way I can align the line left or right in the TRichEdit component?

Clarification

I wish to align only a portion of the text, not all of it.

Upvotes: 2

Views: 4824

Answers (1)

Ken White
Ken White

Reputation: 125671

As Sertac mentioned in a comment, you use the TRichEdit.Paragraph.Alignment.

RichEdit1.Paragraph.Alignment := taLeftJustify;
RichEdit1.Lines.Add('This line is left justified.');
RichEdit1.Paragraph.Alignment := taCenterJustify;
RichEdit1.Lines.Add('This line is centered.');
RichEdit1.Paragraph.Alignment := taRightJustify;
RichEdit1.Lines.Add('This line is right justified');

Upvotes: 3

Related Questions