Wednesday, 24 August 2011

C++ CListCtrl Image List disapear on click FIX

To fix this problem with the icon vanishing change ILC_COLOR32  to ILC_COLOR24
e.g.
 m_ImageList=new CImageList();
 m_ImageList->Create(32,32,ILC_COLOR24,0,3);
 hIcon1 = hIcon1=AfxGetApp()->LoadIcon(IDI_ICON_CUSTOM_PAL_COLOR);
 c1 = m_ImageList->Add(hIcon1);
 hIcon2=AfxGetApp()->LoadIcon(IDI_ICON_CUSTOM_PAL_GREY);
 c2 = m_ImageList->Add(hIcon2);
 hIcon3=AfxGetApp()->LoadIcon(IDI_ICON_CUSTOM_PAL_MONO);
 c3 = m_ImageList->Add(hIcon3);

No comments:

Post a Comment