Back to Devexpress

BarManager.QueryShowPopupMenu Event

windowsforms-devexpress-dot-xtrabars-dot-barmanager-bbf80ee5.md

latest4.6 KB
Original Source

BarManager.QueryShowPopupMenu Event

Occurs when a control’s PopupContextMenu is about to appear.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public event QueryShowPopupMenuEventHandler QueryShowPopupMenu
vb
<DXCategory("Events")>
Public Event QueryShowPopupMenu As QueryShowPopupMenuEventHandler

Event Data

The QueryShowPopupMenu event's data class is QueryShowPopupMenuEventArgs. The following properties provide information specific to this event:

PropertyDescription
BreakShowPopupMenuGets or sets whether or not the parent BarManager.QueryShowPopupMenu event should affect only the BarManager itself.
CancelGets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
ControlGets a control whose popup menu is queried.
MenuGets the popup menu that is about to be displayed.
PositionGets or sets the position of the queried menu popup.

Remarks

This event allows you to customize the menu assigned to a control’s PopupContextMenu extender property. This property is automatically added at design time to all controls that have the same parent as the BarManager component. At runtime, the PopupContextMenu extender property can be set via the BarManager.SetPopupContextMenu method.

For more information, see the BarManager topic.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the QueryShowPopupMenu event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-spreadsheet-spell-check-cell-text/CS/SpreadsheetSpellchecking/Form1.cs#L22

csharp
popupMenu.Manager = BarManager;
BarManager.QueryShowPopupMenu += OnBarManager_QueryShowPopupMenu;

winforms-spreadsheet-spell-check-cell-text/VB/SpreadsheetSpellchecking/Form1.vb#L24

vb
popupMenu.Manager = BarManager
AddHandler Me.BarManager.QueryShowPopupMenu, AddressOf OnBarManager_QueryShowPopupMenu
AddHandler Me.spreadsheetControl.CellEditorOpened, AddressOf OnSpreadsheetControl_CellEditorOpened

See Also

GetPopupContextMenu(Control)

SetPopupContextMenu(Control, PopupMenuBase)

BarManager Class

BarManager Members

DevExpress.XtraBars Namespace