Link to home
Start Free TrialLog in
Avatar of flavo
flavoFlag for Australia

asked on

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 :-)
Avatar of flavo
flavo
Flag of Australia image

ASKER

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>
Dave? You answering your own questions agani...?

:-)
ASKER CERTIFIED SOLUTION
Avatar of GhostMod
GhostMod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of flavo

ASKER

The Q's I ask are just tooo easy....

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

Dave :-)