TreeView Control Questions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'll admit, it was late....but I could not find the answer to these two
questions.

How can determine if the node that a user clicked on:

1) is a parent (top level only)?
2) has children?

Thanks
 
Hi,

Private Sub trvNorthWind_AfterSelect(ByVal sender As Object, ByVal e As
System.Windows.Forms.TreeViewEventArgs) Handles trvNorthWind.AfterSelect

Dim n As TreeNode

n = e.Node

If n.Parent Is Nothing Then

Debug.WriteLine("Top Level")

End If

Debug.WriteLine(String.Format("Number of children {0}",
n.GetNodeCount(False)))



End Sub



Ken

------------------------

I'll admit, it was late....but I could not find the answer to these two
questions.

How can determine if the node that a user clicked on:

1) is a parent (top level only)?
2) has children?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top