ContextMenu.HorizontalOffset Property
Get or sets the horizontal distance between the target origin and the popup alignment point.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
[BindableAttribute(true)] [TypeConverterAttribute(typeof(LengthConverter))] public double HorizontalOffset { get; set; }
<object HorizontalOffset="double"/> - or – <object HorizontalOffset ="qualifiedDouble"/>
XAML Values
Property Value
Type: System.DoubleThe horizontal distance between the target origin and the popup alignment point. For information about the target origin and popup alignment point, see Popup Placement Behavior. The default is 0.
You can position a ContextMenu by setting the PlacementTarget, PlacementRectangle, Placement, HorizontalOffset, and VerticalOffsetProperty properties. These properties behave the same as they do for a Popup. For more information, see Popup Placement Behavior.
The following example shows how to use the HorizontalOffset property to cause a ContextMenu to open at a specified location in relation to its button parent.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.