动态添加navbar相关代码

41次阅读
没有评论
with dxNavBar1 do begin
//Create items with Items.Add do begin
Caption := 'Inbox';
LargeImageIndex := 3; SmallImageIndex := 3; //...
end;
with Items.Add do
begin
Caption := 'Outbox';
LargeImageIndex := 7; SmallImageIndex := 7;
//...
end;
with Items.Add do
begin
caption := 'News';
LargeImageIndex := 5; SmallImageIndex := 5;
//...
end;
//Create groups
with Groups.Add do
begin
Caption := 'Local';
LargeImageIndex := 4; SmallImageIndex := 4; LinksUseSmallImages := True; UseSmallImages := False; //Create links for Inbox and Outbox items
CreateLink(Items[0]); CreateLink(Items[1]);
end;
with Groups.Add do
begin
Caption := 'News';
LargeImageIndex := 6; SmallImageIndex := 6; LinksUseSmallImages := False; UseSmallImages := True; //Create a link for the News item
CreateLink(Items[2]);
end;
//Set the AdvExplorerBarView view
View := dxNavBarViewsFactory.GetIDFromName('AdvExplorerBarView');
//Assign image lists
LargeImages := LargeImageList; SmallImages := SmallImageList;
end;

代码出处ExpressNavBar.pdf,65页
代码未测试

正文完