displaying pics when click on a tree node

M

madushanka sugath

hi all...im new to dot net. i created a treeview, and wish to display
pictures in a picture box when click on a child node.
clicking on different child nodes will display different pics in picture
box..Can someone help me. thanx in advance!!!
 
K

kimiraikkonen

hi all...im new to dot net. i created a treeview, and wish to display
pictures in a picture box when click on a child node.
clicking on different child nodes will display different pics in picture
box..Can someone help me. thanx in advance!!!

*** Sent via Developersdexhttp://www.developersdex.com***

Hi,
As you should have a picturebox to display pictures, you need to
handle TreeView's AfterSelect event to accomplish it.,

Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.TreeViewEventArgs) _
Handles TreeView1.AfterSelect
If e.Node.Name = "child_node_name" Then

PictureBox1.ImageLocation = "location_of_image"

End If
End Sub

Note that you need to determine how you will select location_of_image
which is just a string, as it's not understandable from your message
that it's up to you where you will assign a image path to
ImageLocation property to your Picturebox.

Hope this helps,

Onur Güzel
(e-mail address removed)
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top