TextDecoration.Location Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the vertical location at which the text decoration is drawn.

Namespace:   System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)

member Location : TextDecorationLocation with get, set

Property Value

Type: System.Windows.TextDecorationLocation

The vertical location at which the text decoration is drawn.

The following example shows the locations of the text decorations relative to the text.

Diagram of text decoration locations

Example of text decoration types

The PenOffset property enables you to offset the text decoration from the specified Location.

Identifier field

LocationProperty

Metadata properties set to true

None

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

No code example is currently available or this language may not be supported.
<!-- Use the default font values for the strikethrough text decoration. -->
<TextBlock
  TextDecorations="Strikethrough"
  FontSize="36" >
  The quick red fox
</TextBlock>

.NET Framework
Available since 3.0
Return to top
Show: