MFC树控件:如何将多个图标添加到树视图项目? [英] MFC Tree Control: How to add multiple icons to a tree view item?
本文介绍了MFC树控件:如何将多个图标添加到树视图项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试向Treeview项显示多个图标,但未显示所有图标,仅显示了一个.
我正在使用CImageList m_imageState;
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 );
但是当我看到Treeview时,项目仅显示一个图标.
是否可以在Treeview项目中显示多个图标?
请提出我该怎么做.
谢谢
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
推荐答案
,您需要仔细看一下:
http://msdn.microsoft.com/en-us/library/8bkz91b4%28v = VS.80%29.aspx [ ^ ]
使用此代码完成的操作会将一堆图像添加到图像列表中,在什么时候将这些图像与树控件中的项目相关联?
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?
这篇关于MFC树控件:如何将多个图标添加到树视图项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文