Skip to main content

PopupMenuShowingEventArgs.Menu Property

Gets or sets the menu that is about to be displayed.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v22.1.dll

NuGet Package: DevExpress.Win.Navigation


public DXPopupMenu Menu { get; set; }

Property Value

Type Description

The menu that is about to be displayed.


You can handle the LayoutControl.PopupMenuShowing event to customize the menu before it is displayed. Use the Menu property to access the menu object and customize its contents.


The following example shows how to add custom menu items to the Context Menu via the LayoutControl.PopupMenuShowing event.

Two menu items are added: Save Layout which saves the current layout to a memory buffer; and Restore Layout which restores the previously saved layout. Clicking these items will call the LayoutControl.SetDefaultLayout and LayoutControl.RestoreDefaultLayout methods respectively.

The image below shows the resultant menu:


using DevExpress.XtraLayout;
using DevExpress.Utils.Menu;

private void layoutControl1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) {
   e.Menu.Items.Add(new DXMenuItem("&Save Layout", new EventHandler(SaveLayout)));
   e.Menu.Items.Add(new DXMenuItem("&Restore Layout", new EventHandler(RestoreLayout)));

private void SaveLayout(object sender, EventArgs e) {

private void RestoreLayout(object sender, EventArgs e) {
See Also