"Kelvin Bryant" <ke***********@hotmail.com> wrote in message
news:0b****************************@phx.gbl...
I have tried the following code to set the index for a
node. It seems to work when I use the root node index of
0. When I try a number greater than 0 I get an out of
range error. I made sure that the tree was expanded, as
well.
treeView1.Focus();
treeView1.SelectedNode = treeView1.Nodes[1];
Note that treeView1.Nodes is only the list of nodes branching off the root;
not all the nodes in the entire tree.
treeView1.Nodes[1].Nodes is the list of nodes that branch off node 1, and so
forth. It's a recursive data structure.