Treeview - Counting childs

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

Guest

Hello.
I have a treeview control, where i'd like to do a tree click event that
returns the key of all the nodes conected to the parent of the selected item.
The number of child nodes for the parent nodes are not necessarilly the same.

Can anyone help me on this?

Thanks
 
Hi,
if you need children - you can use child property and then next property to
get all children
if you need parent - use parent property
a reference to clicked node comes as event argument
 
Yes.
But how can i start from a certain child, get the key of the other
"brothers", and don't loose the reference of the selected child?
 
as i understand you - using .Next
here a sample how to make all children of nParent checked:
If nParent.Children > 0 Then
Set nChild = nParent.Child
For intI = 1 To nParent.Children
nChild.Checked = True
Set nChild = nChild.Next
Next intI
End If
 
OK. thanks

Alex Dybenko said:
as i understand you - using .Next
here a sample how to make all children of nParent checked:
If nParent.Children > 0 Then
Set nChild = nParent.Child
For intI = 1 To nParent.Children
nChild.Checked = True
Set nChild = nChild.Next
Next intI
End If
 
Back
Top