officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-paragraphpropertiesbase-23b6d242.md
Gets or sets the paragraph’s text alignment.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
ParagraphAlignment? Alignment { get; set; }
Property Alignment As ParagraphAlignment?
| Type | Description |
|---|---|
| Nullable<ParagraphAlignment> |
A ParagraphAlignment enumeration value or null ( Nothing in Visual Basic) for a mixture of paragraphs with different alignments.
|
Available values:
| Name | Description | Example |
|---|---|---|
| Left |
Text is aligned to the left of the paragraph.
|
| | Right |
Text is aligned to the right of the paragraph.
|
| | Center |
Text is aligned to the center of the paragraph.
|
| | Justify |
Text is justified to the entire width of the paragraph.
|
| | JustifyLow |
If the language is Arabic, the paragraph uses small length Kashida. In other languages, text is justified with short inter-word spacing.
|
| | JustifyMedium |
If the language is Arabic, the paragraph uses medium-length Kashida. In other languages, text is justified with wider inter-word spacing.
|
| | JustifyHigh |
If the text is Arabic, the paragraph uses the kashida with the widest length. For other languages, paragraph text is justified with the widest inter-word spacing.
|
| | Distribute |
The text is evenly distributed between right and left margins. If the last line is short, extra space is added between the characters so the line matches the paragraph’s width.
|
| | ThaiDistribute |
Text is aligned between right and left margins by adding an extra space between each two characters. Affects languages with tone marks and vowel marks.
|
|
The Alignment property value depends on the RightToLeft property.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Alignment property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Styles.cs#L45
pstyle.LineSpacingType = ParagraphLineSpacing.Double;
pstyle.Alignment = ParagraphAlignment.Center;
document.ParagraphStyles.Add(pstyle);
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/StylesActions.cs#L45
pstyle.LineSpacingType = ParagraphLineSpacing.Double;
pstyle.Alignment = ParagraphAlignment.Center;
document.ParagraphStyles.Add(pstyle);
winforms-rich-edit-text-formatting/CS/Text Formatting Example/Form1.cs#L69
//Set the paragraph alignment
titleParagraphFormatting.Alignment = ParagraphAlignment.Center;
winforms-richedit-tables-simple-example/CS/TablesSimpleExample/Form1.cs#L134
ParagraphProperties alignment = document.BeginUpdateParagraphs(table[0, 2].ContentRange);
alignment.Alignment = ParagraphAlignment.Center;
document.EndUpdateParagraphs(alignment);
word-document-api-table-examples/CS/Program.cs#L116
ParagraphProperties alignment = document.BeginUpdateParagraphs(table[0, 1].ContentRange);
alignment.Alignment = ParagraphAlignment.Center;
document.EndUpdateParagraphs(alignment);
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Styles.vb#L41
pstyle.LineSpacingType = DevExpress.XtraRichEdit.API.Native.ParagraphLineSpacing.[Double]
pstyle.Alignment = DevExpress.XtraRichEdit.API.Native.ParagraphAlignment.Center
document.ParagraphStyles.Add(pstyle)
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/StylesActions.vb#L38
pstyle.LineSpacingType = ParagraphLineSpacing.Double
pstyle.Alignment = ParagraphAlignment.Center
document.ParagraphStyles.Add(pstyle)
winforms-rich-edit-text-formatting/VB/Text Formatting Example/Form1.vb#L65
'Set the paragraph alignment
titleParagraphFormatting.Alignment = ParagraphAlignment.Center
winforms-richedit-tables-simple-example/VB/TablesSimpleExample/Form1.vb#L110
Dim alignment As ParagraphProperties = document.BeginUpdateParagraphs(table(0, 2).ContentRange)
alignment.Alignment = ParagraphAlignment.Center
document.EndUpdateParagraphs(alignment)
word-document-api-examples/VB/CodeExamples/StylesActions.vb#L65
pstyle.LineSpacingType = DevExpress.XtraRichEdit.API.Native.ParagraphLineSpacing.[Double]
pstyle.Alignment = DevExpress.XtraRichEdit.API.Native.ParagraphAlignment.Center
' Add the style to the collection of paragraph styles.
See Also
ParagraphPropertiesBase Interface