Skip to main content
Bar

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.v23.2.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

Returns

Type Description
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:

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}">
BarManager.SetMenuShowMouseButton(textEdit1, ButtonSwitcher.LeftButton);
See Also