TextDecoration.PenOffset Property

Definition

Gets or sets the text decoration's offset from its Location.

C#
public double PenOffset { get; set; }

Property Value

The text decoration's offset from its Location. The default is 0.

Examples

The following code example shows how to set the PenOffset property.

C#
// Move the text decoration lower using pixel value units.
myUnderline.PenOffset = 2;
myUnderline.PenOffsetUnit = TextDecorationUnit.Pixel;
myUnderline.PenThicknessUnit = TextDecorationUnit.Pixel;
XAML
<!-- Move the text decoration lower using pixel value units. -->
<TextDecoration PenOffset="2" PenOffsetUnit="Pixel" PenThicknessUnit="Pixel" />

Remarks

A negative value moves the text decoration higher, while a positive value moves the text decoration lower. Use the PenOffsetUnit property to specify how the units of this value are interpreted.

Dependency Property Information

Item Value
Identifier field PenOffsetProperty
Metadata properties set to true None

Applies to

Tuote Versiot
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also