TreeView.Nodes[1].Nodes[1]
Momerath
Nearly a Senior Poster
3,386 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
You'd have to develop a method. For example:
public TreeNode GetNode(int[] pos) {
TreeViewNodeCollection nodeCollection = myTreeView.Nodes;
for (int i = 0; i < pos.Length - 1; i++) {
nodeCollection = nodeCollection[pos[i]].Nodes;
}
return nodeCollection.Nodes[pos[pos.Length-1]];
}
Note: This is just off the top of my head, I may have things spelled wrong. It'll also throw exceptions if the child nodes don't exist.
A better method would be to recursively walk the node tree and find what it is you wanted, but you'd need a way to tell if you've found the one you want :)
Momerath
Nearly a Senior Poster
3,386 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558