The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TextDecoration.PenOffset Property

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

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

public double PenOffset { get; set; }
/** @property */
public double get_PenOffset ()

/** @property */
public void set_PenOffset (double value)

public function get PenOffset () : double

public function set PenOffset (value : double)

<object PenOffset="double" .../>

Property Value

The text decoration's offset from its Location.

The default value is 0.

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.

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

<!-- Move the text decoration lower using pixel value units. -->
<TextDecoration PenOffset="2" PenOffsetUnit="Pixel" PenThicknessUnit="Pixel" />

// Move the text decoration lower using pixel value units.
myUnderline.PenOffset = 2;
myUnderline.PenOffsetUnit = TextDecorationUnit.Pixel;
myUnderline.PenThicknessUnit = TextDecorationUnit.Pixel;

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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft