TextBlock.TextDecorations プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
TextBlockのテキストに適用する効果を含むTextDecorationCollectionを取得または設定します。
public:
property System::Windows::TextDecorationCollection ^ TextDecorations { System::Windows::TextDecorationCollection ^ get(); void set(System::Windows::TextDecorationCollection ^ value); };
public System.Windows.TextDecorationCollection TextDecorations { get; set; }
member this.TextDecorations : System.Windows.TextDecorationCollection with get, set
Public Property TextDecorations As TextDecorationCollection
プロパティ値
この要素に適用するテキスト装飾を含む TextDecorationCollection コレクション。 既定値は null です (テキスト装飾は適用されません)。
例
次の例は、 TextDecorations 属性を設定する方法を示しています。
<TextBlock TextDecorations="Strikethrough">
This text will render with the strikethrough effect.
</TextBlock>
次の図は、この例がどのようにレンダリングされるかを示しています。
次の図は、 OverLine、 Baseline、および Underline 装飾のレンダリング方法を示しています。
次の例は、TextDecorations プロパティをプログラムで設定する方法を示しています。
TextBlock textBlock = new TextBlock(new Run("This text will render with the strikethrough effect."));
textBlock.TextDecorations = TextDecorations.Strikethrough;
Dim textBlock As New TextBlock(New Run("This text will render with the strikethrough effect."))
textBlock.TextDecorations = TextDecorations.Strikethrough
注釈
TextDecoration オブジェクトは、テキストに追加できる視覚的な装飾です。 テキスト装飾には、下線、ベースライン、取り消し線、およびオーバーラインの 4 種類があります。 テキスト装飾の詳細については、「 方法: テキスト装飾を作成する」を参照してください。
既定では、このプロパティは null に設定され、関連付けられている TextDecorationCollection はありません。 テキスト効果を追加する前に、新しい TextDecorationCollection を作成し、このプロパティに割り当てます。
依存関係プロパティ情報
| 品目 | 価値 |
|---|---|
| 識別子フィールド | TextDecorationsProperty |
に設定されたメタデータ プロパティ true |
AffectsRender |