Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 22nd, 2003, 05:08 PM
Registered User
 
Join Date: Sep 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jbacha
Default how do I launch a form from treeview in VB.net

I need to launch a form from a treeview
I have designed my treeview
I click on one of the nodes to generate the selected event
how do I find wich node I clicked to run a module.
I tried declaring varible as TreeNode
 event code
sub treeview1_selected()

dim firstNode as TreeNode
dim selectNode as TreeNode
selectNode = me.treeview1.SelectedNode
firstNode=????
if selectNode = firstNode then
    launchForm()
end if
I appreciate any help

 
Old October 22nd, 2003, 06:39 PM
Registered User
 
Join Date: Sep 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jbacha
Default

I think i found the answer
use the index property of the treenode.

dim a as treenode = e.node
 if a.index =1 then...



 
Old October 23rd, 2003, 10:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

better, read the key from the tree.selectedimage.key and do a select case to know wich form you have to launch....

HTH...

Gonzalo Bianchi
 
Old October 23rd, 2003, 06:20 PM
Registered User
 
Join Date: Sep 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jbacha
Default

how do i figure the node index
when there are multiple roots or child root nodes?






Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set a form as startup form in vb.net 2.0 mallikalapati .NET Framework 2.0 1 February 21st, 2008 09:19 AM
Migration of treeview from VB6 to VB.NET karveajit General .NET 0 March 27th, 2007 01:34 AM
Migration of Treeview from VB6 to VB.NET karveajit ASP.NET 1.0 and 1.1 Professional 0 March 27th, 2007 01:25 AM
Why does it take so long to launch a VS.NET app? panuvin General .NET 0 December 14th, 2006 07:27 PM
Urgent VB form Migration to VB.net form kvenkat_2k1 Pro VB.NET 2002/2003 1 December 7th, 2005 04:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.