Skip to main content
Bar

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PopupMenuBase.BeforePopup Event

Allows you to customize the popup menu before it is displayed onscreen.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DXCategory("Events")]
public event CancelEventHandler BeforePopup

#Event Data

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

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled.

#Remarks

You can handle the BeforePopup event to customize the popup menu before it is displayed onscreen. For instance, you can add, remove or disable particular links. Use the PopupMenuBase.ItemLinks property to access the link collection of the popup menu.

The BeforePopup event occurs when the popup window is about to be displayed even if it does not contain any items within the ItemLinks collection. So, you can use the event to dynamically populate the popup menu. Note that if the popup menu does not contain links, it will not be displayed.

After the popup menu is displayed, the PopupMenuBase.Popup event is fired.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the BeforePopup 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.

See Also