社区
Delphi
帖子详情
treeview的用法
haoming0
2003-04-13 11:12:54
如何建立动态树? 谢谢
...全文
69
2
打赏
收藏
treeview的用法
如何建立动态树? 谢谢
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
haoming0
2003-04-13
打赏
举报
回复
给解释一下吧?
短歌如风
2003-04-13
打赏
举报
回复
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;
TreeView
用法
动态绑定
Treeview
,子节点,父节点,
TreeView
用法
C#WinForm窗体
treeview
用法
例子
适合C# wingform窗体学习者学习,借鉴
qml中
treeview
用法
qml中
treeview
的
用法
,界面跟后端数据交互,简单的教学例子
treeview
的
用法
?
string[] mypicture = System.IO.Directory.GetFiles("" + Application.StartupPath + @"\picture", "*.*", System.IO.SearchOption.AllDirectories); foreach (string mystr in mypicture) { string mypic = mystr.Substring(mystr.LastIndexOf("\\") + 1); string myspilt=mypic.Substring(mypic.LastIndexOf('.')+1).ToLower(); if (myspilt == "jpg" || myspilt == "gif" || myspilt == "bmp") { this.
treeView
1.SelectedNode.Nodes.Add(mypic); } } this.
treeView
1.SelectedNode.Expand();//展开所有节点;
树的使用方法,
TreeView
使用方法
树的使用方法,
TreeView
使用方法,实例,请大家下载
Delphi
5,939
社区成员
262,944
社区内容
发帖
与我相关
我的任务
Delphi
Delphi 开发及应用
复制链接
扫一扫
分享
社区描述
Delphi 开发及应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章