Back to Devexpress

BarManager.MenuShowMouseButton Attached Property

wpf-devexpress-dot-xpf-dot-bars-dot-barmanager-369b79f9.md

latest2.6 KB
Original Source

BarManager.MenuShowMouseButton Attached Property

Specifies which mouse button should be clicked to display a context menu for an object within the BarManager.

This is an attached property.

Namespace : DevExpress.Xpf.Bars

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

See GetMenuShowMouseButton(UIElement) and SetMenuShowMouseButton(UIElement, ButtonSwitcher).

Returns

TypeDescription
ButtonSwitcher

A ButtonSwitcher enumeration value indicating which mouse button should be clicked to display a context menu for an object within the BarManager.

|

Remarks

Use the MenuShowMouseButton attached property to specify which mouse button should be clicked to display a custom context menu for any control within the BarManager. In code, you can use the BarManager.SetMenuShowMouseButton and BarManager.GetMenuShowMouseButton methods for this purpose.

The following example demonstrates how to show a text box’s context menu on clicking the left mouse button:

xaml
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
...
<TextBox x:Name="textEdit1" Text="Left-click this text box for a context menu" dxb:BarManager.MenuShowMouseButton="LeftButton" ContextMenu="{x:Null}">
csharp
BarManager.SetMenuShowMouseButton(textEdit1, ButtonSwitcher.LeftButton);

See Also

GetMenuShowMouseButton(UIElement)

SetMenuShowMouseButton(UIElement, ButtonSwitcher)

BarManager Class

BarManager Members

DevExpress.Xpf.Bars Namespace