Skip to main content
A newer version of this page is available. .

Selecting and Clicking Links

  • 2 minutes to read

When navigating through the NavBar control item links, you can perform various link actions. You can click, select, move links within a group where they belong, etc. To enable item link selection set the NavBar control’s OptionsBehavior.Common.AllowSelectLinks property to True.

You can control selection within the NavBar control via several properties. The Group.SelectedLinkIndex property specifies the index of the currently selected item link within a specific group. If this property value is -1, then no link is selected within a group. If the NavBar control’s OptionsBehavior.Common.EachGroupHasSelectedLink property value is True, then each group can have a single selected link at the same time. Otherwise, there can be only a single selected link within the NavBar control. To determine the selection status of an individual item link use its IsSelected property.

You can handle the Group.OnSelectedLinkChanged event to process the selection changes within a specific group.

End-users can click links using the mouse or keyboard (via accelerator keys). To add an accelerator key to an item link, place an ampersand (“&”) before a character in the item’s Caption. This will allow end-users to press Alt+<character> combination to click this item’s links.

If the TabStop property is set to True, end-users can move through groups, item links, and an overflow panel‘s elements using the keyboard. Pressing the Enter or Space key while a link is focused, clicks this link.

There are several ways to process links clicking within a NavBar control:

If you assign an instance of the TAction class or its descendant to the Item.Action property, then clicking an item link invokes the corresponding action. In this case link clicking is handled and additional operations are not required. Since there are many standard action types (they all can be created and managed via the TActionList component), you can easily implement the large number of actions via setting the Action property.

Note

if you assign an OnClick event handler, then the Action is not in effect.