Connecting Tech Pros Worldwide Help | Site Map

Treeview with link

  #1  
Old January 6th, 2009, 08:42 AM
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
How to use a treeview when I click the node a form will show to the screen...

please help me...thanks God bless...
  #2  
Old January 6th, 2009, 10:27 AM
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,485
Provided Answers: 1

re: Treeview with link


Are you fetching any data from database and want to display on a form ?

or you want to open a new form each time you click on a new node ?
  #3  
Old January 6th, 2009, 02:57 PM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,384

re: Treeview with link


Hi,

In node click event, depending on the node caption , call the form..
Something like this :

Expand|Select|Wrap|Line Numbers
  1. If TrVw.SelectedItem.Text = "Customers" Then
  2. frmCustomers.Show
  3. Elseif TrVw.SelectedItem.Text = "Orders" Then
  4. frmOrders.Show
  5. End If
  6.  
REgards
Veena
  #4  
Old January 8th, 2009, 02:48 AM
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26

re: Treeview with link


Quote:
Originally Posted by debasisdas View Post
Are you fetching any data from database and want to display on a form ?

or you want to open a new form each time you click on a new node ?

I want to open a new form each time I click on a new node...
  #5  
Old January 8th, 2009, 02:54 AM
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26

re: Treeview with link


Quote:
Originally Posted by QVeen72 View Post
Hi,

In node click event, depending on the node caption , call the form..
Something like this :

Expand|Select|Wrap|Line Numbers
  1. If TrVw.SelectedItem.Text = "Customers" Then
  2. frmCustomers.Show
  3. Elseif TrVw.SelectedItem.Text = "Orders" Then
  4. frmOrders.Show
  5. End If





REgards
Veena


where can I find node event???
Do I have to declare some variable because i got this error on the first line
"object variable or with block variable not set"

Is costumer a name for a node???
  #6  
Old January 8th, 2009, 03:20 AM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,384

re: Treeview with link


Hi,

On your Form, Double Click the TreeView, and from event's list, Select the NodeClick event..
From my code, change the name of Control Treeview , Give your control name accordingly..

Regards
Veena
  #7  
Old January 8th, 2009, 12:26 PM
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26

re: Treeview with link


Quote:
Originally Posted by QVeen72 View Post
Hi,

On your Form, Double Click the TreeView, and from event's list, Select the NodeClick event..
From my code, change the name of Control Treeview , Give your control name accordingly..

Regards
Veena

Thanks you so much... it works...

How to put image on the treeview??/
how to initialize

God bless
  #8  
Old January 9th, 2009, 05:59 AM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,384

re: Treeview with link


Hi,

Add an ImageList Control to your Form.
Add All the Images,
Select Treeview's Property : ImageList = ImageList1
Now when you add nodes, To Set 4th Image in Image List :
Give this syntax:

TrVw.Nodes.Add , , "MynewNode", "New Node", 4

Change Images's Index Accordingly..

Regards
Veena
  #9  
Old January 10th, 2009, 02:43 PM
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26

re: Treeview with link


Quote:
Originally Posted by QVeen72 View Post
Hi,

Add an ImageList Control to your Form.
Add All the Images,
Select Treeview's Property : ImageList = ImageList1
Now when you add nodes, To Set 4th Image in Image List :
Give this syntax:

TrVw.Nodes.Add , , "MynewNode", "New Node", 4

Change Images's Index Accordingly..

Regards
Veena


Thanks God bless....
  #10  
Old January 11th, 2009, 02:55 PM
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26

re: Treeview with link


Quote:
Originally Posted by debasisdas View Post
Are you fetching any data from database and want to display on a form ?

or you want to open a new form each time you click on a new node ?


what if I am fetching data freom the databse??/ can you help me with that???
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate a treeview with a xml string ippo answers 2 October 19th, 2007 11:05 AM
Treeview with 3-state checkboxes? cowznofsky answers 4 November 27th, 2006 01:45 PM
Save treeView as XML ??? serge calderara answers 3 November 15th, 2006 09:45 PM
Exemple needed to reorganize nodes(treeview) with mouse (change Nodes order) Marc R. answers 4 February 2nd, 2006 08:06 PM