为什么我无法使用nodx的next呢?

scorpioncom 2005-11-28 10:10:09
Set nodx1 = TreeView1.Nodes.Add(, , "root", "root")
Set nodx = TreeView1.Nodes.Add("root", 4, "child1", "child1")
TreeView1.Nodes.Add "root", 4, "child2", "child2"
TreeView1.Nodes.Add "child1", 4, "child1-1", "child1-1"
TreeView1.Nodes.Add "root", 4, "child3", "child3"
TreeView1.Nodes.Add "root", 4, "child4", "child4"
TreeView1.Nodes.Add "child2", 4, "child2-2", "child2-2"
TreeView1.Nodes.Add "child3", 4, "child3-3", "child3-3"
nodx.EnsureVisible

nodx1.Children有4个child
但为什么无法使用nodx1.next属性来一个一个的显示下一个child呢
...全文
88 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Tiger_Zhao 2005-11-28
  • 打赏
  • 举报
回复
set nodx2 =nodx1.child
while not nodx2 is nothing
...
set nodx2 = nodx2.next
wend
scorpioncom 2005-11-28
  • 打赏
  • 举报
回复
本来nodx1就有4个child.但用nodx1.child.next只能返回child1的对象.如何能看到child2,child3,child4呢?
scorpioncom 2005-11-28
  • 打赏
  • 举报
回复
没有看懂, For i=1 to nodex1.children 其中的i给谁了?
oho1937 2005-11-28
  • 打赏
  • 举报
回复
晕,处理和赋值写反了,应该这样
if nodex1.children>0 then
set nodex=nodx1.child
For i=1 to nodex1.children
....
....
set nodex=nodex1.child
next
end if
oho1937 2005-11-28
  • 打赏
  • 举报
回复
if nodex1.children>0 then
set nodex=nodx1.child
For i=1 to nodex1.children
set nodex=nodex1.child
....
....
next
end if

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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