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的第二列不能显示图标

解决方案 »

  1.   

    http://www.codeproject.com/listctrl/ReportControl.asp
      

  2.   

    是不是一个LISTCONTRL 只能有一个图标
    我也想用两个!
      

  3.   

    http://www.codeproject.com/listctrl/ReportControl.asp
    提供的例子有bug,它重载了Create函数,如果你要是动态创建的话就会失败!
      

  4.   

    试试用 BOOL SetItem( const LVITEM* pItem );
      

  5.   

    LVS_EX_SUBITEMIMAGES 
    Version 4.70. Allows images to be displayed for subitems. This style is available only in conjunction with the LVS_REPORT style.
      

  6.   

    我好像依稀仿佛记得LIST VIEW CONTROL可以在subitem显示图标的。请仔细查一下CREATE和SetExtendedStyle方法的说明,里面似乎某个LVS_活着LVS_EX_常数提到过这个……啊的确是这样:LVS_EX_SUBITEMIMAGES 
    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. 看来是可以的……希望上面的东西对楼主有帮助。