From Xojo Documentation

Property (As Integer )
aParagraph.Alignment = newIntegerValue
IntegerValue = aParagraph.Alignment

Supported for all project types and targets.

Gets the text alignment of the paragraph.


You can use either the integer values or the class constants, AlignDefault, AlignLeft, AlignCenter, or AlignRight, to set or get the alignment:

Name Description
AlignDefault Default alignment
AlignLeft Left alignment
AlignCenter Centered alignment
AlignRight Right alignment

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.

Dim st As New StyledText
st = TextArea1.StyledText
TextArea1.AppendText("This is the appended text.")
st.Bold(0, 4) = True
st.ParagraphAlignment(0) = Paragraph.AlignRight