CImageList cil1;
cil1.Create(32,32,TRUE,2,2);
cil1.Add(AfxGetApp()->LoadIcon(IDI_ICON));
m_list.SetImageList(&cil1,LVSIL_NORMAL);
m_list.InsertItem(0,"aa",0);这样在列表框里只有aa,但是没有相应的图标。请问如何正确加载图标呢,这个问题还真够菜,不过没办法了。
cil1.Create(32,32,TRUE,2,2);
cil1.Add(AfxGetApp()->LoadIcon(IDI_ICON));
m_list.SetImageList(&cil1,LVSIL_NORMAL);
m_list.InsertItem(0,"aa",0);这样在列表框里只有aa,但是没有相应的图标。请问如何正确加载图标呢,这个问题还真够菜,不过没办法了。
把它作为成员变量定义,不要在函数体内定义!
把CImageList cill放在头文件中定义应该没问题!