How to select specific node in TreeView ??? (URGENT)

  • Thread starter Thread starter tiger79
  • Start date Start date
T

tiger79

Hi,
I have a Treeview that's filled with 5 root-nodes. Under those rootNodes I
have a couple of chil-nodes who have a couple of childnodes of their own
(big family huh)...
I'd like to be able to open a Form for every one of those child nodes
depending where the user clicks on the TreeView... I have tried using the
Index but that doesnt work cause the index of the root is 0 to 4 and the
index of the childs are starting also from 0, so when I tell him to do
something with Index 0 it will do the same for the first child as for the
root...
I allso have the problem that the first time I select the plus/minus box in
front of the 1st rootnode it doesnt open but selects the node ???
Anyone can help me out please ???
 
Use the AfterSelect Event the treeView.SelectedNode will contain the
selected Node.

The AfterSelect will only fire when opening or closing the tree if no node
in the tree has been selected yet.

You can also use the Nodes Tag Property to hold a particular value or even
the form object you want to show itself (depending on number of forms etc) .

James McCutcheon
 
hhhmmm i dont understand what u mean :(
so a possible solution is to have like the first item selected so that the
AfterSelect wont fire when i try to open the node the first ime ??? And if
so, any idea what the code is to accomplish his (the selection of for
example the first node) ???
thanx...
 
Back
Top