如何完全删除一棵树

sanshui_yangfei 2003-08-21 09:34:15
只要删掉根节点,还是每个item都要删,给个例程来看看!
...全文
192 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
rogery 2003-08-22
  • 打赏
  • 举报
回复
删除一个树,不知道的人还以为用斧子呢???

同楼上,删除一个树把相关的数据删除就可以了。
pingxin 2003-08-21
  • 打赏
  • 举报
回复
你是要只删除树还是要同时删除数据库中的数据?
若是只删除树,则删除树的根结点即可;若要同时删除数据库中的数据,
如果树是多层且数据库没有一个字段可检索出所有数据的话则需要编一个
递归调用的用户函数!
workhand 2003-08-21
  • 打赏
  • 举报
回复
long Ll_tvi
Do Until tv_1.finditem(RootTreeItem!,0) = -1
Ll_tvi = tv_1.finditem(RootTreeItem!,0)
tv_1.DeleteItem(Ll_tvi)
Loop
jdsnhan 2003-08-21
  • 打赏
  • 举报
回复
deleteitem(1),删除根节点,即全部删除
chrisfy 2003-08-21
  • 打赏
  • 举报
回复
long ll_tvi
do until 树形控件名称.finditem(roottreeitem!, 0) = -1
树形控件名称.deleteitem(ll_tvi)
loop
incats 2003-08-21
  • 打赏
  • 举报
回复
If all items are children of a single item at the root level, you can delete all items in the TreeView with the handle for RootTreeItem as the argument for DeleteItem. Otherwise, you need to loop through the items at the first level.

604

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 控件与界面
社区管理员
  • 控件与界面社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧