Share via


TextDecorations.Strikethrough 屬性

定義

指定刪除線 TextDecoration

public:
 static property System::Windows::TextDecorationCollection ^ Strikethrough { System::Windows::TextDecorationCollection ^ get(); };
public static System.Windows.TextDecorationCollection Strikethrough { get; }
static member Strikethrough : System.Windows.TextDecorationCollection
Public Shared ReadOnly Property Strikethrough As TextDecorationCollection

屬性值

表示刪除線 TextDecoration 的值。

範例

在下列範例中,會使用筆刷的純色筆刷來建立刪除線文字裝飾。 Location 屬性會設定為 Strikethrough

// Use the default font values for the strikethrough text decoration.
private void SetDefaultStrikethrough()
{
    // Set the underline decoration directly to the text block.
    TextBlock1.TextDecorations = TextDecorations.Strikethrough;
}
' Use the default font values for the strikethrough text decoration.
Private Sub SetDefaultStrikethrough()
    ' Set the underline decoration directly to the text block.
    TextBlock1.TextDecorations = TextDecorations.Strikethrough
End Sub
<!-- Use the default font values for the strikethrough text decoration. -->
<TextBlock
  TextDecorations="Strikethrough"
  FontSize="36" >
  The quick red fox
</TextBlock>

備註

下列範例顯示相對於文字的刪除線文字裝飾位置。

文字裝飾位置的圖表
刪除線文字裝飾的範例

適用於