Click here to Skip to main content
15,887,302 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
i need to add image only to the rootnode of treecontrol not to its child node please help me out
i am using this
treeView1.ImageList = imageList;
it is adding image to even child node which i dont want please help me out..
Posted

1 solution

<quote>treeView1.ImageList = imageList;
it is adding image to even child node which i dont want please help me out..

False: all it does is assigning an ImageList to your TreeView control.
To set an image:
C#
yourNode.ImageIndex = 0;

will set the image with index 0 in the ImageList to your node.

To unset an image:
C#
yourNode.ImageIndex = -1;
 
Share this answer
 
Comments
rahuls1 27-Nov-13 2:26am    
ya it is ok but one problem that a space is created between check box and node text how to remove it..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900