Back to Devexpress

Paragraph.Alignment Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-paragraph-f616394b.md

latest7.8 KB
Original Source

Paragraph.Alignment Property

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

Declaration

csharp
public abstract ParagraphAlignment Alignment { get; set; }
vb
Public MustOverride Property Alignment As ParagraphAlignment

Property Value

TypeDescription
ParagraphAlignment

Indicates a paragraph alignment.

|

Available values:

NameDescriptionExample
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 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-table-of-contents-practical-guide/CS/Form1.cs#L108

csharp
Document.EndUpdateCharacters(cp);
Document.Paragraphs[0].Alignment = ParagraphAlignment.Center;
Document.Paragraphs[0].Style = Document.ParagraphStyles["Normal"];

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Table.cs#L39

csharp
{
    p.Alignment = ParagraphAlignment.Center;
}

word-document-api-use-printablecomponentlink-to-print-document/CS/PrintingSystem/Form1.cs#L26

csharp
_header.Fields.Create(_header.Range.Start,"DATE \\@ \"dddd, MMMM dd, yyyy HH:mm:ss\" \\MERGEFORMAT");
_header.Paragraphs[0].Alignment = ParagraphAlignment.Right;
srv.Document.Sections[0].EndUpdateHeader(_header);

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/TableActions.cs#L43

csharp
{
    p.Alignment = ParagraphAlignment.Center;
}

word-processing-table-of-contents-practical-guide/CS/Program.cs#L142

csharp
Paragraph paragraph = document.Paragraphs[0];
paragraph.Alignment = ParagraphAlignment.Center;
paragraph.Style = document.ParagraphStyles["Normal"];

winforms-richedit-table-of-contents-practical-guide/VB/Form1.vb#L100

vb
Document.EndUpdateCharacters(cp)
Document.Paragraphs(0).Alignment = ParagraphAlignment.Center
Document.Paragraphs(0).Style = Document.ParagraphStyles("Normal")

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Table.vb#L36

vb
For Each p As DevExpress.XtraRichEdit.API.Native.Paragraph In document.Paragraphs.[Get](tbl.FirstRow.Range)
    p.Alignment = DevExpress.XtraRichEdit.API.Native.ParagraphAlignment.Center
Next

word-document-api-use-printablecomponentlink-to-print-document/VB/PrintingSystem/Form1.vb#L26

vb
_header.Fields.Create(_header.Range.Start, "DATE \@ ""dddd, MMMM dd, yyyy HH:mm:ss"" \MERGEFORMAT")
_header.Paragraphs(0).Alignment = ParagraphAlignment.Right
srv.Document.Sections(0).EndUpdateHeader(_header)

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/TableActions.vb#L37

vb
For Each p As Paragraph In document.Paragraphs.Get(tbl.FirstRow.Range)
    p.Alignment = ParagraphAlignment.Center
Next p

word-document-api-examples/VB/CodeExamples/TablesActions.vb#L64

vb
For Each p As DevExpress.XtraRichEdit.API.Native.Paragraph In document.Paragraphs.[Get](tbl.FirstRow.Range)
    p.Alignment = DevExpress.XtraRichEdit.API.Native.ParagraphAlignment.Center
Next

See Also

Alignment

Paragraph Class

Paragraph Members

DevExpress.XtraRichEdit.API.Native Namespace