PlacementRectangle Property

ContextMenu.PlacementRectangle Property


Gets or sets the area relative to which the context menu is positioned when it opens.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

member PlacementRectangle : Rect with get, set

Property Value

Type: System.Windows.Rect

The area that defines the rectangle that is used to position the context menu. The default is Empty.

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.

Identifier field


Metadata properties set to true


The following example shows how to use the PlacementRectangle property and specify where the ContextMenu is placed.

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft