用parent.child.children属性,判断

解决方案 »

  1.   

    得不到,等TREEVIEW控件的下一版本吧。
      

  2.   

    它父节点(node.parent)的所有子节点.
      

  3.   

    用tv.Nodes(1).FullPath 可以得到所有接点的LABEL。
    中间是用“/”分割的,你也可以自己定义
      

  4.   

    Private Sub Form_Load()
        For i = 1 To 10
            TreeView1.Nodes.Add , , , "main" + Str(i)
            For j = 1 To 10
                TreeView1.Nodes.Add i, 4, , "sub" + Str(i)
            Next
        Next
    End SubPrivate Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
        Dim N As Integer
        Dim intNodPos As Integer
        intNodPos = 0
        N = Node.FirstSibling.Index
        Do While N <> Node.LastSibling.Index
            intNodPos = intNodPos + 1
            If N = Node.Index Then
                MsgBox ("the position of node that clicked is " + Str(intNodPos))
                Exit Do
            End If
            N = TreeView1.Nodes(N).Next.Index
            If N = Node.LastSibling.Index Then
                MsgBox ("the position of node that clicked is " + Str(intNodPos + 1))
            End If
            
        Loop
                
            
        
    End Sub