TextDecorationLocation Enumeration
.NET Framework (current version)
Specifies the vertical position of a TextDecoration object.
Assembly: PresentationCore (in PresentationCore.dll)
| Member name | Description | |
|---|---|---|
| Baseline | The vertical position of a baseline. | |
| OverLine | The vertical position of an overline. | |
| Strikethrough | The vertical position of a strikethrough. | |
| Underline | The vertical position of an underline. This is the default value. |
Text decorations are available in four types: baseline, overline, strikethrough, and underline. The following example shows the locations of the text decorations relative to the text.

Text decoration types
The following example creates an underline text decoration and uses a solid color brush for the pen.
<!-- Use a Red pen for the underline text decoration --> <TextBlock FontSize="36" > jumped over <TextBlock.TextDecorations> <TextDecorationCollection> <TextDecoration PenThicknessUnit="FontRecommended"> <TextDecoration.Pen> <Pen Brush="Red" Thickness="1" /> </TextDecoration.Pen> </TextDecoration> </TextDecorationCollection> </TextBlock.TextDecorations> </TextBlock>
.NET Framework
Available since 3.0
Available since 3.0
Show: