Connecting Tech Pros Worldwide Forums | Help | Site Map

Treeview with link

nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
#1: Jan 6 '09
How to use a treeview when I click the node a form will show to the screen...

please help me...thanks God bless...

debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,511
#2: Jan 6 '09

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 ?
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,385
#3: Jan 6 '09

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
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
#4: Jan 8 '09

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...
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
#5: Jan 8 '09

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???
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,385
#6: Jan 8 '09

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
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
#7: Jan 8 '09

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
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,385
#8: Jan 9 '09

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
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
#9: Jan 10 '09

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....
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
#10: Jan 11 '09

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