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
   [Collapse]Bars
    [Collapse]Tutorials
      Add and Remove Toolbars
      Add Bar Items To Toolbars
      Bar Item Links
      Provide Functionality to Bar Items
      Toolbar Customization
      Recently Used Items
      Create Popup Menus
     MDI Merging
    [Expand]Bar Manager Designer
    [Expand]Runtime Customization and Layout Management
    [Expand]Appearance and Hotkeys
   [Expand]Ribbon
   [Expand]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]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]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Create Popup Menus

Below is a brief tutorial about creating popup menus. Refer to this article for detailed information.

  1. Locate the PopupMenu in VS Toolbox and drop in onto the form (user control).
  2. Invoke the menu smart tag and click the "Customize" link. This will invoke the Customization Window dialog and the popup menu preview.

  3. Drag the menu preview away so it does not overlap the Customization Window and start adding item links to this menu. To add a new bar item, click the [Add] button and select an item type. To add a link to an existing bar item, drag the required item from the Customization Window's "Commands" tab and drop it onto the menu (see the figure below).

  4. You can categorize item links into groups by adding BarHeaderItem items.

    A Bar Header Item provides means of customizing all item links that follow this header. For example, at the figure below the "Alignment" Header Item utilizes the BarHeaderItem.MultiColumn and BarHeaderItem.OptionsMultiColumn properties to arrange links into two columns and enable large glyphs.

  5. Assign your menu to the required control. There are multiple ways of doing this.

    • To associate a menu with a drop-down button, utilize the BarButtonItem.DropDownControl property.
    • When a Bar Manager is present on a form, all controls expose the PopupContextMenu property (in the VS Properties window, this property has a name similar to "PopupContextMenu on barManager1"). Assign your menu to this property and this menu will automatically pop up when end-users right-click the target control.
    • To display a menu manually, call the required PopupMenu.ShowPopup method overload from code.

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