vc给List加图标

  1.加载图标:
                    添加图标,并修改ID为IDI_ICON1
2.在APP里添加对象变量:
                                           CImageList    m_ImageList;
3.在APP的InitInstance()函数里:
                                                     m_ImageList.Create(24,24,ILC_COLOR8|ILC_MASK,2,2);
                                                       //创建
                                                      m_ImageList.Add(LoadIcon(IDI_ICON1));
                                                      //添加
4.给控件LIST添加图标:
  m_List.SetImageList( &(((CMYApp*)AfxGetApp())->m_ImageList),LVSIL_SMALL);

你可能感兴趣的:(list,imagelist)