Expand treeview nodes

  • Thread starter Thread starter SamSpade
  • Start date Start date
S

SamSpade

I want to expand nodes on a treeview. What I have is an array (SubFolder) of
node.text not index.

What I'd like to do is the folowing:

lKey = tvFolders.Nodes(0) ) 'Not in SubFolder

For lLpCnt = 0 To UBound(lSubFolder) - 1

lKey.Expand() 'But do not expand the last node

lKey = lKey.Nodes(SubFolder(lLpCnt))

Next

But Nodes takes an index not the node's text.

I hope I don't have to loop looking for a matched text - Do I?



Thanks in advance
 
* " SamSpade said:
I want to expand nodes on a treeview. What I have is an array (SubFolder) of
node.text not index.

What I'd like to do is the folowing:

lKey = tvFolders.Nodes(0) ) 'Not in SubFolder

For lLpCnt = 0 To UBound(lSubFolder) - 1

lKey.Expand() 'But do not expand the last node

lKey = lKey.Nodes(SubFolder(lLpCnt))

Next

But Nodes takes an index not the node's text.

I hope I don't have to loop looking for a matched text - Do I?

The node's text sometimes isn't unique. What you can do is setting up a
'Hashtable' which stores (text, 'TreeNode') pairs and can be used to
lookup nodes by name.
 
Back
Top