• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 371
  • Last Modified:

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 :-)
0
flavo
Asked:
flavo
  • 2
1 Solution
 
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
 
GhostModCommented:
PAQd, 250 points refunded.

GhostMod
Community Support Moderator
0
 
flavoAuthor Commented:
The Q's I ask are just tooo easy....

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

Dave :-)
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now