treeview的用法 如何建立动态树? 谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 var Action: TAction; Category: String; CatList: TStrings; CatIndex: Integer; I: Integer; Node: TTreeNode; ParentNode: TTreeNode; GroupIndex: Integer; GroupExpanded: Integer; SeparatorIndex: Integer;begin tvActions.Images.Assign(Actions.Images); GroupIndex := tvActions.Images.Count; GroupExpanded := GroupIndex + 1; SeparatorIndex := GroupExpanded + 1; FExpandedIndex := GroupExpanded; FCollapsedIndex := GroupIndex; tvActions.Images.AddImages(imgsAdded); CatList := TStringList.Create; try for I := 1 to Actions.ActionCount - 1 do begin try Action := TAction(Actions.Actions[I]); Category := Action.Category; CatIndex := CatList.IndexOf(Category); if CatIndex < 0 then begin ParentNode := tvActions.Items.AddChild(nil, Category); ParentNode.ImageIndex := GroupIndex; ParentNode.SelectedIndex := GroupIndex; Node := tvActions.Items.AddChild(ParentNode, '分隔符'); Node.ImageIndex := SeparatorIndex; Node.SelectedIndex := SeparatorIndex; CatIndex := CatList.AddObject(Category, ParentNode); end; ParentNode := TTreeNode(CatList.Objects[CatIndex]); Node := tvActions.Items.AddChild(ParentNode, Action.Caption); Node.ImageIndex := Action.ImageIndex; Node.SelectedIndex := Action.ImageIndex; Node.Data := Action; except end; end; finally CatList.Free; end;end; delphi2007不能直接运行,注册应用层? devexpress中那个组件具有TreeComboBox功能? 如何压缩SQL Server数据库日志文件 d7怎么安装QReport组件?在线等... 小问题麻烦大家(online waiting) 有谁在做用delphi写dicom方面的东西,可以研究一下。 Dephi & WebBroker & (CGI|WinCGI|ISAPI) 该项目为一个毕业设计,报酬商议定。 关于日期运算人问题.... 关于左右分栏打印,请教QuickRep高手! 急急急! 小第有一个关于扑克游戏制作的问题? 使用GetMessage()但不想等待消息到来?
Action: TAction;
Category: String;
CatList: TStrings;
CatIndex: Integer;
I: Integer;
Node: TTreeNode;
ParentNode: TTreeNode;
GroupIndex: Integer;
GroupExpanded: Integer;
SeparatorIndex: Integer;
begin
tvActions.Images.Assign(Actions.Images);
GroupIndex := tvActions.Images.Count;
GroupExpanded := GroupIndex + 1;
SeparatorIndex := GroupExpanded + 1;
FExpandedIndex := GroupExpanded;
FCollapsedIndex := GroupIndex;
tvActions.Images.AddImages(imgsAdded);
CatList := TStringList.Create;
try
for I := 1 to Actions.ActionCount - 1 do
begin
try
Action := TAction(Actions.Actions[I]);
Category := Action.Category;
CatIndex := CatList.IndexOf(Category);
if CatIndex < 0 then
begin
ParentNode := tvActions.Items.AddChild(nil, Category);
ParentNode.ImageIndex := GroupIndex;
ParentNode.SelectedIndex := GroupIndex;
Node := tvActions.Items.AddChild(ParentNode, '分隔符');
Node.ImageIndex := SeparatorIndex;
Node.SelectedIndex := SeparatorIndex;
CatIndex := CatList.AddObject(Category, ParentNode);
end;
ParentNode := TTreeNode(CatList.Objects[CatIndex]);
Node := tvActions.Items.AddChild(ParentNode, Action.Caption);
Node.ImageIndex := Action.ImageIndex;
Node.SelectedIndex := Action.ImageIndex;
Node.Data := Action;
except
end;
end;
finally
CatList.Free;
end;end;