TdxRibbon

TdxRibbon

var

dxBarManager1: TdxBarManager;
dxRibbon1: TdxRibbon;

procedure TForm2.cxButton1Click(Sender: TObject);
var
  item: TdxBarItemLink;
  grp: TdxRibbonTabGroup;
  tab: TdxRibbonTab;
  toolbar: TdxBar;
  btn: TdxBarButton;
  i: Integer;
begin
  tab := dxRibbon1.Tabs.Add;
  tab.Caption := 'tab1';
  grp := tab.Groups.Add;
  grp.Caption := 'grp1';
  toolbar := dxBarManager1.AddToolBar;
  grp.toolbar := toolbar;
  for i := 1 to 2 do
  begin
    btn := TdxBarButton(dxBarManager1.AddItem(TdxBarButton));
    //btn.imageIndex := 888;
    btn.Caption := 'btn' + i.ToString;
    item := toolbar.ItemLinks.Add;
    item.Item := btn;
    //btn.OnClick := nil;
  end;
end;

  

posted @ 2020-09-10 20:45  delphi中间件  阅读(702)  评论(0编辑  收藏  举报