Connecting Tech Pros Worldwide Help | Site Map

Treeview with link

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 6th, 2009, 07:42 AM
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
Default Treeview with link

How to use a treeview when I click the node a form will show to the screen...

please help me...thanks God bless...
Reply
  #2  
Old January 6th, 2009, 09:27 AM
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,310
Default

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 ?
Reply
  #3  
Old January 6th, 2009, 01:57 PM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,383
Default

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
Reply
  #4  
Old January 8th, 2009, 01:48 AM
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
Default

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...
Reply
  #5  
Old January 8th, 2009, 01:54 AM
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
Default

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???
Reply
  #6  
Old January 8th, 2009, 02:20 AM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,383
Default

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
Reply
  #7  
Old January 8th, 2009, 11:26 AM
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
Default

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
Reply
  #8  
Old January 9th, 2009, 04:59 AM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,383
Default

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
Reply
  #9  
Old January 10th, 2009, 01:43 PM
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
Default

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....
Reply
  #10  
Old January 11th, 2009, 01:55 PM
nurikoAnna's Avatar
Newbie
 
Join Date: Nov 2008
Posts: 26
Default

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
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.