Skip to content

Actions Property

Description

Collection of CommandBars Action items that have been added to the CommandBars.

Property Type

Read-only property

Syntax (Visual Basic)

Public Property Actions() As [CommandBarActions](XtremeCommandBars~CommandBarActions.md)

Remarks

The Actions property allows you to add and access the CommandBars Action items that have been added to your CommandBars.

CommandBar Actions eliminate the need to use the Update event to update or change the state and properties of an item that appears in multiple places in your menus and toolbars. For example, you might have a menu item that also appears in a toolbar, and a user might have created the same button and placed it in a user-created toolbar. With Actions, you can simply modify the action for the item, and it will update all occurrences of the item, no matter how many a user might have added.

Actions also work well for localization, as you can have a set of actions for each locale that can easily be used to update all occurrences of items, ensuring that all items get updated.

How It Works

Each CommandBar item has an Id. Items with the same Id can then share a common set of properties. A CommandBars Action object, represented as "Item Actions" in the diagram below, is a set of properties that all items of a specified Id can share. When you add an Action, you will specify the Id, Caption, TooltipText, DescriptionText, and Category of the action. The Id is the Id you will assign to CommandBar items that you want to use the properties of the action.

Now, any CommandBar item with the same Id as an Action will use the properties of the action. When updating any property of the action, it will automatically update all occurrences of the item, regardless of how many a user might have added, whether it is in a popup menu or in a toolbar. You will no longer have to use the Update event to update or change the state and properties of an item that appears in multiple places in your menus and toolbars.

EnableActions must be called to enable actions to be used. Each CommandBar Item has an Action property, which is just a reference to the CommandBars Action item that is associated with it. If no action is added for an item or actions have not been enabled, the default properties of the item will be used.

In the diagram below, the "Menu Item," "Toolbar Item," and "User Customized Item (user-created toolbar)" all share the same "Item Action." When you modify the properties of the action, it will update all occurrences of the item.

Actions Diagram

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.