2

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.

Nasreddine Galfout
  • 2,550
  • 2
  • 18
  • 36

1 Answers1

3

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');
Ken White
  • 123,280
  • 14
  • 225
  • 444