Home > Software engineering >  How to get a certain item in the ListCtrl iImage?
How to get a certain item in the ListCtrl iImage?

Time:05-01

 

Is the small icon pattern//m_list
M_Imagelist. Create (24, 24, ILC_COLOR32 | ILC_MASK, 0, 1);
M_Imagelist. Add (AfxGetApp () - & gt; LoadIcon (IDI_ICON0));
M_Imagelist. Add (AfxGetApp () - & gt; LoadIcon (IDI_ICON1));
M_list. SetImageList (& amp; M_Imagelist LVSIL_SMALL);
M_list. InsertItem (0, _T (" not checked "), 0).
M_list. InsertItem (1, _T (" selected "), 1);

Question: how to obtain the specified item iImage???????

//use the following methods cannot get
LVITEM lv.
Lv. The iItem=0;
Lv. Mask=LVIF_IMAGE;
M_list. The GetItem (& amp; Lv);
Int iImage=lv. IImage;//this is a random number

  • Related