From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Property (As TextAlignments )
aParagraph.TextAlignment = newTextAlignmentsValue
TextAlignmentsValue = aParagraph.TextAlignment

New in 2019r2

Supported for all project types and targets.

Gets the text alignment of the paragraph.


The values of this property are set using the TextAlignments enumeration.

To set the alignment of a paragraph, call the ParagraphAlignment method of the StyledText class. You can use the Paragraph or the TextField alignment constants to set a paragraph alignment using the ParagraphAlignment method.

Sample Code

This is an example of a right-aligned first paragraph.

Var st As New StyledText
st = TextArea1.StyledText
TextArea1.AddText("This is the added text.")
st.Bold(0, 4) = True
st.Paragraph(0).TextAlignment = TextAlignments.Right