Treeview -> Count fellow children

I know we can return the number of fellow children with

node.parent.children

But I need to count the first level of children

Example of treeview

Dad
   - son
        - something
Mum
   - Daughter
        - something

So if i click Dad, i want to return 2

Cheers!

Dave :-)
LVL 34
flavoAsked:
Who is Participating?
 
GhostModCommented:
PAQd, 250 points refunded.

GhostMod
Community Support Moderator
0
 
flavoAuthor Commented:
Found this

http://www.codecomments.com/archive337-2005-1-374282.html

<CODE>

Dim nodX As Node
Dim lChildNodeCount As Long

For Each nodX In TreeView1.Nodes
If Not nodX.Parent Is Nothing Then
lChildNodeCount = lChildNodeCount + 1
End If
Next

</CODE>
0
 
dannywarehamCommented:
Dave? You answering your own questions agani...?

:-)
0
 
flavoAuthor Commented:
The Q's I ask are just tooo easy....

I was hoping for a property or something... oh well...

Dave :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.