Results 1 to 4 of 4

Thread: simple treeview question

  1. #1
    nullus
    Guest

    simple treeview question

    i'm only just learning to use the treeview control, and i need to be able to determine if the node the user just clicked on is a child node. i can't seem to find any property that tells you that. thanks.

  2. #2
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Use the .Parent property, if the node .Parent is not Nothing then it is a child of something.....
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  3. #3
    nullus
    Guest
    hehe, yeah, i just tried this

    VB Code:
    1. Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
    2.     If (Node.Parent Is Not Nothing) Then
    3.         MsgBox Node.Text
    4.     End If
    5. End Sub

    but it says "Invalid use of object"

  4. #4
    nullus
    Guest

    whoops

    was using the Not keyword wrong

    VB Code:
    1. Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
    2.     If Not (Node.Parent Is Nothing) Then
    3.         MsgBox Node.Text
    4.     End If
    5. End Sub

    thanks for the reply

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