CommandBarButtons.Add

Syntax:

Add(<Name>, <ButtonType>, <Text>, <Action>)

Parameters:

<Name> (optional)

Type: String.
Button name should follow name rules. It is unique within a command bar.

<ButtonType> (optional)

Type: CommandBarButtonType.
Interface button type(separator, action, popup).
Default value: Splitter.

<Text> (optional)

Type: String.
Button text.

<Action> (optional)

Type: Action.
Action that should be performed when user clicks this button. For Separator and Popup button types you do not have to specify an action.

Returned value:

Type: CommandBarButton.

Description:

Adds a button to the end of command bar button collection.

Availability:

Thick client.

Example:

CP = Controls.CommandBar;
NewAction = New Action("MyProcedureInFormModule");
ButtonType = CommandBarButtonType.Action;
NewButton = CP.Buttons.Add("Action1", ButtonType, , NewAction);


    

1C:Enterprise Developer's Community