如何left/right在rich edit (Delphi)中对齐行?

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

有什么方法可以让 TRichEdit 组件中的线左对齐或右对齐?

澄清

我只想对齐文本的一部分,而不是全部。

正如 Sertac 在评论中提到的,您使用 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');