Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Collapse]Ribbon, Bars and Menu
   [Expand]Bars
   [Expand]Ribbon
   [Collapse]Popup Menus
    [Collapse]Popup Menus Customization
      Populating Popup Menus
      Showing Popup Menus
    Radial Menu
   [Expand]Common Features
   [Expand]Examples
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Populating Popup Menus

Expanded Populating Popup Menus

When you place a PopupMenu component onto a form at design time, you can use the menu's Editor to add and remove items from it. Right-click the popup menu component and select the Customize option. This invokes the Customization Window that provides access to the available bar items and opens the menu's Editor:

Note

Before customizing and using a popup menu, add a BarManager or RibbonControl to the form and ensure that the popup menu is bound to this BarManager/RibbonControl. By default, a popup menu being added to the form at design time automatically looks for a BarManager/Ribbon Control within the form, and if it's found, binds itself to the located object via the PopupMenuBase.Manager/PopupMenuBase.Ribbon property. When creating the menu at runtime, you may need to manually bind it to a is not bound to a BarManager/Ribbon Control via these properties.

The following image shows the Customization Window and a popup menu's Editor:

You can use drag and drop to move items from the Customization Window onto the menu, move items within the menu or remove items from the menu. When you place a bar item onto a menu (or a bar), a link to this item is created, and placed within a target component instead of the item. For general information on items and links, refer to the Bar Item Links document.

To manage an item collection for a popup menu via code, use the PopupMenuBase.ItemLinks collection. It allows you to add, remove and access individual items.

Expanded Example

The following code shows how to create a popup menu and add two items to it:

How would you rate this topic?​​​​​​​