英語で読む

次の方法で共有


TextAlignment 列挙型

定義

オブジェクト内のテキストが左揃え、右揃え、中央揃え、または両端揃えのいずれであるかを指定します。

C#
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
public enum TextAlignment
継承
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, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9