共用方式為


TextAlignment 列舉

定義

指定物件中的文字是靠左對齊、靠右對齊、置中還是靠右對齊。

public enum class TextAlignment
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
public enum TextAlignment
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)>]
type TextAlignment = 
Public Enum TextAlignment
繼承
TextAlignment
屬性

欄位

名稱 Description
Left 0

Default. 文字對齊在左側。

Right 1

文字對齊於右側。

Center 2

文字置中。

Justify 3

文字對齊。

範例

在以下範例中,屬性 TextAlignment 設定為 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 為左、右、中心和正直。

適用於