Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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