Treeview - Counting childs

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
 
A

Alex Dybenko

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
 
G

Guest

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?
 
A

Alex Dybenko

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
 
G

Guest

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
 

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

Top