2 Replies - 1094 Views - Last Post: 05 August 2012 - 11:35 PM Rate Topic: -----

#1 Mangore  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 174
  • Joined: 11-October 08

TreeView: how to select Child of parent?

Posted 05 August 2012 - 02:45 PM

This code is for parent how to do same thing with child of parent?
If e.Node.Index = 1 Then
MsgBox("Parent")
End If
Is This A Good Question/Topic? 0
  • +

Replies To: TreeView: how to select Child of parent?

#2 _HAWK_  Icon User is online

  • Master(Of Foo)
  • member icon

Reputation: 959
  • View blog
  • Posts: 3,687
  • Joined: 02-July 08

Re: TreeView: how to select Child of parent?

Posted 05 August 2012 - 09:32 PM

Use the level property for the root node.

If e.Node.Level = 0 Then
     Debug.WriteLine("Parent")
Else
     Debug.WriteLine("Child")
End If


Or if you consider a parent as any child that has contains child nodes then:

If e.Node.Nodes.Count > 0 The
     Debug.WriteLine("Parent")
Else
     Debug.WriteLine("Child")
End If 

Was This Post Helpful? 0
  • +
  • -

#3 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 1959
  • View blog
  • Posts: 8,700
  • Joined: 29-May 08

Re: TreeView: how to select Child of parent?

Posted 05 August 2012 - 11:35 PM

Wouldn't Parent.Child be you?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1