不用4楼,用代码实现是这样的
==============
unit CT1;
interface
uses
Business.System, Business.Forms, Justep.Tools.ExpressNavBar;
type
TCT1 = class(TForm)
procedure BizFormShow(Sender: TObject);
private
{private declarations}
dxNavBar1: TdxNavBar;
dxNavBar1Group1: TdxNavBarGroup;
dxNavBar1Group2: TdxNavBarGroup;
dxNavBar1Group3: TdxNavBarGroup;
dxNavBar1Item1: TdxNavBarItem;
dxNavBar1Item2: TdxNavBarItem;
dxNavBar1Item3: TdxNavBarItem;
public
{public declarations}
procedure MyClick(Sender: TObject);
end;
implementation
procedure TCT1.MyClick(Sender: TObject);
begin
Dialogs.Showmessage((Sender as TdxNavBarItem).Caption);
end;
procedure TCT1.BizFormShow(Sender: TObject);
begin
dxNavBar1 := TdxNavBar.Create(Self);
with dxNavBar1 do
begin
Parent := Self;
Left := 80;
Top := 16;
Width := 169;
Height := 361;
ActiveGroupIndex := 0;
DragCopyCursor := -1119;
DragCursor := -1120;
DragDropFlags := [TdxNavBarDragDropFlag.fAllowDragLink, TdxNavBarDragDropFlag.fAllowDropLink, TdxNavBarDragDropFlag.fAllowDragGroup, TdxNavBarDragDropFlag.fAllowDropGroup];
HotTrackedGroupCursor := Business.Forms.Controls.crDefault;
HotTrackedLinkCursor := -1118;
View := 12;
end;
dxNavBar1Group1 := dxNavBar1.Groups.Add;
with dxNavBar1Group1 do
begin
Caption := 'dxNavBar1Group1';
LinksUseSmallImages := True;
SelectedLinkIndex := -1;
ShowAsIconView := False;
ShowControl := False;
TopVisibleLinkIndex := 0;
UseControl := False;
UseSmallImages := True;
Visible := True;
end;
dxNavBar1Group2 := dxNavBar1.Groups.Add;
with dxNavBar1Group2 do
begin
Caption := 'dxNavBar1Group2';
LinksUseSmallImages := True;
SelectedLinkIndex := -1;
ShowAsIconView := False;
ShowControl := False;
TopVisibleLinkIndex := 0;
UseControl := False;
UseSmallImages := True;
Visible := True;
end;
dxNavBar1Group3 := dxNavBar1.Groups.Add;
with dxNavBar1Group3 do
begin
Caption := 'dxNavBar1Group3';
LinksUseSmallImages := True;
SelectedLinkIndex := -1;
ShowAsIconView := False;
ShowControl := False;
TopVisibleLinkIndex := 0;
UseControl := False;
UseSmallImages := True;
Visible := True;
end;
dxNavBar1Item1 := dxNavBar1.Items.Add;
with dxNavBar1Item1 do
begin
Caption := 'dxNavBar1Item1';
Enabled := True;
LargeImageIndex := -1;
SmallImageIndex := -1;
Visible := True;
OnClick := MyClick;
end;
dxNavBar1Item2 := dxNavBar1.Items.Add;
with dxNavBar1Item2 do
begin
Caption := 'dxNavBar1Item2';
Enabled := True;
LargeImageIndex := -1;
SmallImageIndex := -1;
Visible := True;
OnClick := MyClick;
end;
dxNavBar1Item3 := dxNavBar1.Items.Add;
with dxNavBar1Item3 do
begin
Caption := 'dxNavBar1Item3';
Enabled := True;
LargeImageIndex := -1;
SmallImageIndex := -1;
Visible := True;
OnClick := MyClick;
end;
dxNavBar1Group1.CreateLink(dxNavBar1Item1);
dxNavBar1Group1.CreateLink(dxNavBar1Item2);
dxNavBar1Group1.CreateLink(dxNavBar1Item3);
end;
end. |