Treeview Icon help requested

p_nivalis

Active member
Joined
Oct 1, 2004
Messages
33
Programming Experience
5-10
Hello everyone,

I am using the treeview in framework 2.0, and I would like to have the + signs next to the Main nodes, but icons of my choice in the child nodes.

For some reason I am unable to set NO icon for the main nodes so they show only the plus/minus sign. It is always taking on one of the icons in my imagelist by default.

All help greatly appreciated :)
 
You have to add a default icon (for example all white, first item = index 0) and set the treeviews ImageIndex to this index, that way all nodes not set to other index will be default.
 
Thanks. I was already just using a test icon (rather than a white one), with the imageindex set to 0, and it's always showing the icon at index 0 for the Root nodes.

I actually am looking to have no icon on the root nodes at all, so the plusminus can be seen, while still being able to add icons from the imagelist to child nodes.

I have ShowPlusMinus set to true, but it appears that if I associate an imagelist to the treeview, it automatically forces an icon at the root nodes.

Am I doing something wrong?
 
If you add imagelist to treeview all treenodes will use icons. Default imageindex is specified on treeview.imageindex and default value for this property is 0. If you don't specify a different imageindex for a treenode it will display the default.
 
I was afraid to hear that. :)

Here is a screenshot of Trillian (with buddies blocked for their privacy).

tvlr1.jpg


I am trying to recreate that. Do you know of any 3rd part treeview components that can handle that since the .net 2.0 component cant? Preferably free seeing as most of the one's I have seen cost $300+

thanks
 
That image look to me there is an image in every treenode, but no "ShowPlusMinus". You can use a plus image and a minus image, set plus image when node is collapsed and minus image when node is expanded. Check the members available for the Treeview control.
 
hehe Johns right if you look at the minus sign it's actually an image of a minus sign.
 
Back
Top