ContextMenu.HorizontalOffset Property
Get or sets the horizontal distance between the target origin and the popup alignment point. This is a dependency property.
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.
<ContextMenu HorizontalOffset="50" VerticalOffset="50" HasDropShadow="false">
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.