1
procedure
cxDBTreeList1GetNodeImageIndex(Sender:TcxCustomTreeList; ANode: TcxTreeListNode; AIndexType:
2
3 TcxTreeListImageIndexType; var AIndex: TImageIndex);
4 var
5 i :Integer;
6 begin
7 // 给树结点加上图标
8 for i : = 0 to ANode.ValueCount do
9 begin
10 if ANode.Level = 0 then
11 begin
12 ANode.ImageIndex : = 0 ;
13 end
14 else
15 if ANode.Level = 1 then
16 begin
17 ANode.ImageIndex : = 2 ;
18 end
19 else
20 if ANode.Level = 2 then
21 begin
22 ANode.ImageIndex : = 1 ;
23 end ;
24 end ;
25 end ;
26
2
3 TcxTreeListImageIndexType; var AIndex: TImageIndex);
4 var
5 i :Integer;
6 begin
7 // 给树结点加上图标
8 for i : = 0 to ANode.ValueCount do
9 begin
10 if ANode.Level = 0 then
11 begin
12 ANode.ImageIndex : = 0 ;
13 end
14 else
15 if ANode.Level = 1 then
16 begin
17 ANode.ImageIndex : = 2 ;
18 end
19 else
20 if ANode.Level = 2 then
21 begin
22 ANode.ImageIndex : = 1 ;
23 end ;
24 end ;
25 end ;
26