Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

TextDecoration Class

Represents a text decoration, which a visual ornamentation that is added to text (such as an underline).

Namespace:  System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
[LocalizabilityAttribute(LocalizationCategory.None)]
public sealed class TextDecoration : Animatable
<TextDecoration .../>

There are four types of text decorations: underline, baseline, strikethrough, and overline. The following example shows the locations of the text decorations relative to the text.

Example of text decoration types

Diagram of text decoration locations

The following example shows a text decoration that has been styled with a linear gradient brush and a dashed pen.

Example of an underline styled with a linear gradient brush and dashed pen

Text decoration with linear gradient underline

Notice that TextDecoration is derived from Animatable. This makes it possible to apply animated effects to the decoration elements, using a DoubleAnimation for the PenOffset and a ThicknessAnimation for the Pen.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.