PopupMenuBase.BeforePopup Event
Allows you to customize the popup menu before it is displayed onscreen.
Namespace: DevExpress.XtraBars
Assembly: DevExpress.XtraBars.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
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.
Related GitHub Examples
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.