Export (0) Print
Expand All

TextDecorations.Strikethrough Property

Specifies a strikethrough TextDecoration.

Namespace: System.Windows
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public static TextDecorationCollection Strikethrough { get; }
/** @property */
public static TextDecorationCollection get_Strikethrough ()

public static function get Strikethrough () : TextDecorationCollection

You cannot use this property in XAML.

Property Value

A value that represents a strikethrough TextDecoration.

The following example shows the location of a strikethrough text decoration relative to the text.

Example of a strikethrough text decoration


Diagram of text decoration locations

In the following example, a strikethrough text decoration is created by using solid color brush for the pen. The Location property is set to Strikethrough.

<!-- Use the default font values for the strikethrough text decoration. -->
<TextBlock
  TextDecorations="Strikethrough"
  FontSize="36" >
  The quick red fox
</TextBlock>

// 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;
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft