Skip to main content

How to Associate TdxBarPopupMenu with Controls

You can associate a TdxBarPopupMenu with any control on a form. This popup menu will be displayed by right-clicking the appropriate control.

You should use the PopupMenuLinks property of a TdxBarManager object in order to connect a control and a TdxBarPopupMenu.

Follow these steps to associate a control with a TdxBarPopupMenu at design time:

  1. Select a bar manager in the Object Inspector.

  2. Press the ellipsis button (‘…’) in the PopupMenuLinks edit field to display a standard collection editor with a list all existing menu links.

  1. Using this editor you can manage elements within the PopupMenuLinks collection and associate a control with a menu link using the menu link’s TdxBarPopupMenu.Control property.

Note

If a control is associated with several TdxBarPopupMenu objects, it only uses the top menu from the links menu. All the rest are ignored.

The code below demonstrates how you can associate a TEdit with a TdxBarPopupMenu programmatically:

// ...
var
  NewMenuLink : TdxBarPopupMenuLink;
begin
  NewMenuLink := dxBarManager1.PopupMenuLinks.Add;
  NewMenuLink.Control := Edit1;
  NewMenuLink.PopupMenu := dxBarPopupMenu;
end;