Hello there!

I have the following xml File

<A >

Im using the treeview control(i need to insert 2 different images.
How can i add ia certain image to the node it self and another image to the inertext.
So the nodes will represented with image 1, and the text inside with image 2

I have add an image list

Thanks Ahead

Recommended Answers

All 4 Replies

i have read your post i think i can aid you in some of u may have to knew .
first now we have a form that contains the treeview control and have some nodes in it and we want to add an image behind each node i think that what u want.
if ok ? that is the solution....
we should add a control named image list and add some images to it.
after that we should select the treeview control and specify the imagelist property to the previous imagelist control.
then we can specify the image we want to our node from the imageindex property.

if u want any discussion mail me on nigmforcomputer@hotmail.com

hi me waqas,
i could not understan how to show image in the treeview through the imagelist.so is there any body who can help me.

1.you should create an image list and add images to it
2.inside the tee properties ,in the image list section you should add your image list
or you can do
treeView.ImageList=imageList1;//connect tree to image list

3.deicde which image get a node
RootNode.ImageIndex = 0;

Don't confuse treeView.ImageIndex and node.ImageIndex. With treeView.ImageIndex you can define a default image that will be the same for all (unselected) nodes. With node.ImageIndex you can define individual images for each node.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.