1.声明
var
tempitem:TdxnavbarItem;
tempgroup:Tdxnavbargroup;
2.实现
tempgroup:=dxnvbr1.Groups.Add;
tempgroup.Caption := '中国地盘';
tempitem:=dxnvbr1.Items.Add;
tempitem.Caption:= '钓鱼岛';
tempitem.OnClick := belongtochina;
//tempitem.OnClick:= button1.OnClick; //绑定事件
tempgroup.CreateLink(tempitem);
tempitem:=dxnvbr1.Items.Add;
tempitem.Caption := '台湾';
tempitem.OnClick := belongtochina;
tempgroup.CreateLink(tempitem);
/////////////////////////////////////////////
procedure TForm1.FormShow(Sender: TObject);
var
tempitem:TdxnavbarItem;
tempgroup:Tdxnavbargroup;
tree :TTreeView;
node:TTreeNode;
begin
dxnvbr1.Items.Clear;
tempgroup:=dxnvbr1.Groups.Add;
tempgroup.Caption := '中国地盘';
tempitem:=dxnvbr1.Items.Add;
tempitem.Caption:= '钓鱼岛';
tempitem.OnClick := belongtochina;
//tempitem.OnClick:= button1.OnClick; //绑定事件
tempgroup.CreateLink(tempitem);
tempitem:=dxnvbr1.Items.Add;
tempitem.Caption := '台湾';
tempitem.OnClick := belongtochina;
tempgroup.CreateLink(tempitem);
tempgroup := dxnvbr1.Groups.Add;
tempgroup.Caption := '一年四季';
tempitem := dxnvbr1.Items.add;
tempitem.Caption := '春天';
tempitem.OnClick := belongtochina;
tempgroup.CreateLink(tempitem);
tempitem := dxnvbr1.Items.add;
tempitem.Caption := '夏天';
tempitem.OnClick := belongtochina;
tempgroup.CreateLink(tempitem);
tempitem := dxnvbr1.Items.add;
tempitem.Caption := '秋天';
tempitem.OnClick := belongtochina;
tempgroup.CreateLink(tempitem);
tempitem := dxnvbr1.Items.add;
tempitem.Caption := '冬天';
tempitem.OnClick := belongtochina;
tempgroup.CreateLink(tempitem);
tempgroup := dxnvbr1.Groups.Add;
tempgroup.Caption := '病人树';
tempitem := dxnvbr1.Items.Add;
tempitem.caption := '病人树';
tempgroup.createLink(tempitem);
end;
3.CxgridDbcardView添加Optioncustomersize cardexpanding...
本文转自鹅倌51CTO博客,原文链接: http://blog.51cto.com/kaixinbuliao/1006210,如需转载请自行联系原作者