Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load Form on Tree Node Selection

Status
Not open for further replies.

Fletch12

IS-IT--Management
Aug 13, 2002
140
US
Can anyone help me out with loading a 2nd form in a Windows application when a node from a treeview is selected? I need to be able to load this 2nd form but also assign the value of the node selected to a variable. The other piece of this is I have a variable number of treeviews on this 1st form, each with a variable number of nodes and subnodes. Thanks for any help.
 
Check out this FAQ:

faq796-5773
a Thousand ways to transfer data between forms



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day! Ye has a choice: talk like a pira
 
This is helpful, but not quite what I was looking for, which was probably my mistake in my original question. I'm pretty familiar with passing variables to other forms, but I'm struggling with determining which node in the treeview is selected, and then once it is selected assign the nodes value to a variable and load a 2nd form.
 
try using the 'AfterSelect' event of the treeview;
sCurrentNodeText = e.Node.Text
 
Determining which treenode is selected:

Treeview1.SelectedNode

Also, look into the TreeView's AfterSelect event.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day! Ye has a choice: talk like a pira
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top