TextAlignment 列舉
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指定物件中的文字要靠左對齊、靠右對齊、置中、還是對齊。
public enum class TextAlignment
C#
[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
- 繼承
- 屬性
Center | 2 | 文字置中。 |
Justify | 3 | 文字對齊。 |
Left | 0 | 預設值。 文字靠左對齊。 |
Right | 1 | 文字靠右對齊。 |
在下列範例中 TextAlignment ,屬性會設定為 Left。
XAML
<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 和 Justify。
產品 | 版本 |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |