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類別的列舉值為 Left、Right、Center 和兩端。The enumerated values for the TextAlignment class are Left, Right, Center, and Justify.

適用於