Skip to main content

Bar Items and Links

  • 3 minutes to read

This topic provides you with general information on items and links, which are primary elements of the model used for bars, and also demonstrates how bar items can be created. Refer to the Customizing Toolbar Items and Item Controls topic, for details on design-time and runtime customization capabilities provided for these bar elements.

Bar Items

To populate bars and menus with item controls (buttons, submenus, editors, labels, etc.), you need to create bar items. A bar item is a non-visual object that implements specific functionality and specifies:

  • the default appearance settings of a corresponding control;

  • how the control responds to mouse clicks and keyboard events.

Refer to the List of Bar Item Types help topic to learn more.

The ExpressBars Suite provides a number of ways to create bar items. The Commands page of a bar manager’s Customization Form provides the most convenient way in which to manage toolbars and bar items within a form. Refer to the Creating Toolbar Items and Item Controls topic, to learn more.

In addition, this form allows you to:

  • logically organize bar items using categories and item groups;

  • explore a list of all created bar items.

Since a bar item is a non-visual element, an item link is created to represent it onscreen as an item control (also called ‘linked item control’ or ‘item controls corresponding to the item’). An item link contains only appearance aspects of an item control, while all processing is carried out by the bar item.

You can create multiple links for an item, but all of them will provide the same functionality. For instance, you can create an “Open…” item that invokes the Open file dialog and add a link to this item to the main menu and a toolbar.

At design time, the ExpressBars Suite allows you to create an item, an item link and an item control at the same time via the toolbars popup menu or customizing popup menu. Refer to the Creating Toolbar Items and Item Controls topic to learn more.

In addition, the Customization Form allows you to create an item link for the existing bar item by dragging this item from the Commands list on the Commands page and dropping it within a toolbar or menu.

In code, a bar item link is represented by an instance of the TdxBarItemLink class. You can access all the created item links for a particular bar item using the item’s Links collection.

See Also