IToolbarControls.Add

Syntax

Add(Value: IComponent);

Parameters

Value. The component that must be added to the toolbar.

Description

The Add method adds a component to the toolbar.

Comments

The ToolbarButton or ToolbarComboBox components can be placed on the toolbar.

Example

Executing the example requires a form, the Button1 button on the form, and the Toolbar component named Toolbar1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    BarButton: IToolbarButton;
Begin
    BarButton := New ToolbarButton.Create;
    BarButton.Text := "New button";
    Toolbar1.Controls.Add(BarButton);
End Sub Button1OnClick;

After executing the example, clicking the button creates a new button on the toolbar.

See also:

IToolbarControls