Skip to main content

How to Add Buttons to a Toolbar

This topic demonstrates how to add buttons to toolbars at design and runtime.

To add a button at design time, right-click on a toolbar and select Add Button from the popup menu.

To add a large button, select Add LargeButton.

When coding, you should create a link to the button within a toolbar. The following code snippet adds a button to the first toolbar.

// ...
procedure TForm1.AddButtonClick(Sender: TObject);
begin
  with dxBarManager do
  begin
    BeginUpdate;
    try
      with Bars[0].ItemLinks.AddButton do
      begin
        Item.Caption := '&File';
        UserPaintStyle := psCaption;
      end;
    finally
      EndUpdate;
    end;
  end;
end;
See Also