IToolbarControls.Add

Syntax

Add(Value: IComponent);

Parameters

Value - 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, a button named Button1 on it 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 Toolbar1 toolbar.

See also:

IToolbarControls