TextAlignment 枚举

定义

指定对象中的文本是左对齐、右对齐、居中还是两端对齐。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
继承
TextAlignment
属性

字段

Center 2

文本居中。Text is centered.

Justify 3

文本两端对齐。Text is justified.

Left 0

默认。Default. 文本左对齐。Text is aligned to the left.

Right 1

文本右对齐。Text is aligned to the right.

示例

在下面的示例中, TextAlignment将属性设置为 Left。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>

注解

TextAlignment类的枚举值为左对齐、右对齐、居中对齐。The enumerated values for the TextAlignment class are Left, Right, Center, and Justify.

适用于