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.EnsureVisiblenodx1.Children有4个child
但为什么无法使用nodx1.next属性来一个一个的显示下一个child呢

解决方案 »

  1.   

    if nodex1.children>0 then
        set nodex=nodx1.child
        For i=1 to nodex1.children
            set nodex=nodex1.child
            ....
            ....
        next
    end if
      

  2.   

    晕,处理和赋值写反了,应该这样
    if nodex1.children>0 then
        set nodex=nodx1.child
        For i=1 to nodex1.children
            ....
            ....
            set nodex=nodex1.child
        next
    end if
      

  3.   

    没有看懂, For i=1 to nodex1.children 其中的i给谁了?
      

  4.   

    本来nodx1就有4个child.但用nodx1.child.next只能返回child1的对象.如何能看到child2,child3,child4呢?
      

  5.   

    set nodx2 =nodx1.child
    while not nodx2 is nothing
      ...
      set nodx2 = nodx2.next
    wend