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

TdxBarContainerItem, TdxBarItemLink.BeginGroup Example

This example demonstrates using a TdxBarContainerItem in a MDI application. The AddMenu procedure displayed below creates submenus on the parent toolbar with the child form’s main toolbar items. The items are added to the parent toolbar’s container item.

Delphi
procedure AddMenu;
var
  ABarManager: TdxBarManager;
begin
  ABarManager := GetBarManagerByForm(ChildForm1);
  ABarManager.BeginUpdate;
  with dxBarContainerItem1 do
  begin
    ItemLinks := ABarManager.MainMenuBar.ItemLinks;
    Caption := ChildForm1.Caption;
  end;
  ABarManager.EndUpdate;
end;

The following code hides the created submenus.

dxBarContainerItem1.Visible := ivNever;

The following code demonstrates how an existing TdxBarButton can be added to the container item as the first item in a group.

with dxBarContainerItem1 do
  begin
    // adding the item link
    ItemLinks.Add.Assign(dxBarButton1.Links[0]);
    // making the item control first in the group
    ItemLinks.Items[ItemLinks.Count-1].BeginGroup := True;
  end;