微科社区,轻松开发从此开始! 请登陆 免费注册

微科社区

dxBarManager转DxNavBar

时间:2017-01-11 04:01  浏览:努力统计中...
用dxBarManager做的主菜单,界面左侧有DxNavBar,根据dxBarManager菜单项生成DxNavBar,其中DxNavBar中的单击代码怎么从dxBarManager中延续过来呢? -------------------------------------- procedure TFrmMain.dxBar
用dxBarManager做的主菜单,界面左侧有DxNavBar,根据dxBarManager菜单项生成DxNavBar,其中DxNavBar中的单击代码怎么从dxBarManager中延续过来呢?
--------------------------------------
procedure TFrmMain.dxBarManagerToDxNavBar;
var
  i, j: Integer;
  group: TdxNavBarGroup;
  bar: TdxNavBarItem;
begin
  dxNavBar1.Groups.Clear;
  for i := 0 to dxBarManager1Bar1.ItemLinks.Count - 1 do
  item := TdxBarSubItem(dxBarManager1Bar1.ItemLinks[i].Control.Item);
  group := dxNavBar1.Groups.Add;
  group.Caption := item.Caption;
  for j := 0 to item.ItemLinks.Count - 1 do
  begin
  bar.Caption := item.ItemLinks.Items[j].Caption;
  // bar.OnClick := dxNavBarItemClick; ??dxNavBarItemClick这个过程该怎么写
  bar.SmallImageIndex := 10;
  group.CreateLink(bar);
  for j := 0 to item.ItemLinks.Count - 1 do
  item: TdxBarSubItem;
  end;
  end;
  begin
end;

分不够再加

private
procedure ItemClick(Sender: TObject);

implementation

procedure TXX.ItemClick(Sender: TObject);
begin
...

bar.OnClick :=ItemClick;

procedure TFrmMain.dxNavBarItemClick(Sender: TObject);
var i, j:Integer;
item: TdxBarSubItem;
begin
  for i := 0 to dxBarManager1Bar1.ItemLinks.Count - 1 do
  begin
  item := TdxBarSubItem(dxBarManager1Bar1.ItemLinks[i].Control.Item);
  begin
end;
  if item.ItemLinks.Items[j].Caption=(Sender as TdxNavBarItem).Caption then
  bar := dxNavBar1.Items.Add;
  begin
  TdxBarLargeButton(item.ItemLinks.Items[j]).Click;
  Break;
  end;
  end;
  end;
end;
这样有问题么?提示abstract error

没人遇到过这种情况吗
    顶一下
    (0)
    0%
    踩一下
    (0)
    0%
    ------分隔线------