CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Treeview

  1. #1
    Join Date
    Aug 2000
    Posts
    29

    Treeview

    Hi! I am using a treeview in my current project. I already have parent and child nodes in my treeview. I want to determine if the node that I clicked in the treeview is parent node or a child node. Hope you could help me. Thanks.


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Treeview

    You can use a nodes parent property to determine if the node has a parent. If it doesn't the node is a parent node, else it's a child.

    private Sub TreeView1_NodeClick(byval Node as MSComctlLib.Node)

    If Node.Parent is nothing then
    MsgBox "This is a parent"
    else
    MsgBox "This is a child"
    End If

    End Sub




    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured