TextAlignment TextAlignment TextAlignment TextAlignment Enum

Definition

Specifies whether the text in the object is left-aligned, right-aligned, centered, or justified.

public enum class TextAlignment
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
public enum TextAlignment
type TextAlignment = 
Public Enum TextAlignment
Inheritance
TextAlignmentTextAlignmentTextAlignmentTextAlignment
Attributes

Fields

Center Center Center Center 2

Text is centered.

Justify Justify Justify Justify 3

Text is justified.

Left Left Left Left 0

Default. Text is aligned to the left.

Right Right Right Right 1

Text is aligned to the right.

Examples

In the following example, the TextAlignment property is set to Left.

<FlowDocumentReader>
  <FlowDocument
    FontSize="24"
    LineHeight="48"
  >
    <Paragraph TextAlignment="Left" Background="AliceBlue">
      One<LineBreak/>
      two two<LineBreak/>
      Three Three Three<LineBreak/>
      four four four four<LineBreak/>
      Five Five Five Five Five
    </Paragraph>
  </FlowDocument>
</FlowDocumentReader>

Remarks

The enumerated values for the TextAlignment class are Left, Right, Center, and Justify.

Applies to