Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am trying to display multiple icons to the Treeview item but it is not displaying all the icons, it displays only one.
I am using CImageList m_imageState;
m_cTree.m_imageState.Create(16, 16, ILC_MASK, 0, 4);
m_cTree.m_imageState.Add(&bm, RGB(255,255,0));
m_cTree.m_imageState.Add(&bm2, RGB(255,0,255));
m_cTree.m_imageState.Add(&bm, RGB(255,255,0));
m_cTree.m_imageState.Add(&bm1, RGB(0,255,255));

m_cTree.SetImageList( &(m_cTree.m_imageState), TVSIL_NORMAL ); 

But when I see Treeview, item displays only one icon.
Is it possible to display multiple icons with Treeview item?

Please suggest how can I do this.

Thanks
Posted
Updated 12-Apr-11 19:17pm
v3

1 solution

you need to look at this more carefully:
http://msdn.microsoft.com/en-us/library/8bkz91b4%28v=VS.80%29.aspx[^]

what you've done with this code is added a bunch of images to an image list, at what point are you associating those images with the items in the tree control?
 
Share this answer
 
v2
Comments
Nikhil Sisodia 13-Apr-11 0:54am    
Sorry i missed one ....
m_cTree.SetImageList( &(m_cTree.m_imageState), TVSIL_NORMAL );

I am setting Imagelist to treeview before inserting the items to tree.
Albert Holguin 13-Apr-11 17:46pm    
haven't had time to look at this super closely... i apologize, busy with work today!
Albert Holguin 13-Apr-11 17:49pm    
see if this helps:
http://www.functionx.com/visualc/controls/treectrl.htm
Nikhil Sisodia 13-Apr-11 23:18pm    
No, the link is not much helpful with my need.(link shows how to display a single item :( )
Is there any other way you can suggest to implement multiple icons?

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