m_ImageList.Create(24,24,ILC_MASK|ILC_COLOR8,0,4);
m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_ICON1));
m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_ICON2));
m_list.SetImageList(&m_ImageList, LVSIL_SMALL);
m_list.SetExtendedStyle(m_list.GetExtendedStyle()
|LVS_EX_FULLROWSELECT
|LVS_EX_GRIDLINES );m_list.InsertColumn(0, _T("第一列"), LVCFMT_CENTER, 80);
m_list.InsertColumn(1, _T("第二列"), LVCFMT_CENTER, 80);m_list.InsertItem(0,"",0);
m_list.SetItem(0,1,LVIF_IMAGE,"",1,0,0,0);
为什么LIST的第二列不能显示图标
m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_ICON1));
m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_ICON2));
m_list.SetImageList(&m_ImageList, LVSIL_SMALL);
m_list.SetExtendedStyle(m_list.GetExtendedStyle()
|LVS_EX_FULLROWSELECT
|LVS_EX_GRIDLINES );m_list.InsertColumn(0, _T("第一列"), LVCFMT_CENTER, 80);
m_list.InsertColumn(1, _T("第二列"), LVCFMT_CENTER, 80);m_list.InsertItem(0,"",0);
m_list.SetItem(0,1,LVIF_IMAGE,"",1,0,0,0);
为什么LIST的第二列不能显示图标
解决方案 »
- 新建一个对话框就出错,求真相
- VC jpg图片上画矩形(可以理解按钮),
- Visual SourceSafe如何签出整个项目的旧的版本(不是最近版本),貌似只能一个文件一个文件的签出呀,高手帮忙呀!!
- 求教 利用粒子系统实现一个炸弹爆炸的效果
- 类成员变量可以动态创建吗,如何才能实现
- 请问delete()函数怎么用
- 有没有关于串口的病毒??
- TreeCtrlItem.item.pszText=*ptr如何赋值?怎不行?
- 如何识别一张图片中的交通标志?
- GetClientRect的问题
- 请问我再inputpin中得到IMediaSample ,但是我用GetMediaTime或GetTime得不到当前stream time,如何可以得到stream time
- com构件的依赖性怎么解决?!急!
我也想用两个!
提供的例子有bug,它重载了Create函数,如果你要是动态创建的话就会失败!
Version 4.70. Allows images to be displayed for subitems. This style is available only in conjunction with the LVS_REPORT style.
Version 4.70. Allows images to be displayed for subitems. This style is available only in conjunction with the LVS_REPORT style. 这样看来,应该还是可以支持的……再查了一下MSDN,在它的LVM_SETITEM消息里发现这样的话:version 4.70 and later, you can set the iImage member for subitems. The subitem image will be displayed if the list-view control has the LVS_EX_SUBITEMIMAGES extended style. Previous versions will ignore the subitem image. 看来是可以的……希望上面的东西对楼主有帮助。