CListCtrl SetItem
-
hi, I have set the image for a subitem as follows LVITEM litem; litem.mask = LVIF_IMAGE; litem.iSubItem = 1; litem.iItem = 0; litem.iImage = 0; m_List.SetItem( &litem ); but when I try to call the GetItem to get the image associated with a subitem, its not working(it is working if the subitem is 0). I have set the LVS_EX_SUBITEMIMAGES style of the list control. What else should I do.. Please help me nave
-
hi, I have set the image for a subitem as follows LVITEM litem; litem.mask = LVIF_IMAGE; litem.iSubItem = 1; litem.iItem = 0; litem.iImage = 0; m_List.SetItem( &litem ); but when I try to call the GetItem to get the image associated with a subitem, its not working(it is working if the subitem is 0). I have set the LVS_EX_SUBITEMIMAGES style of the list control. What else should I do.. Please help me nave
maybe it is some helpful to you IMAGEINFO ImageInfo; CImageList* m_pImageList = GetImageList(LVSIL_NORMAL); m_pImageList->GetImageInfo(nImage, &ImageInfo);
-
maybe it is some helpful to you IMAGEINFO ImageInfo; CImageList* m_pImageList = GetImageList(LVSIL_NORMAL); m_pImageList->GetImageInfo(nImage, &ImageInfo);
-
Thanks, But What i want to know is the image number associated with a subitem in listctrl. I think the above function won't help me in that.. nave
Naveen R , I have this problem(But I have derived CListCtrl and I use this way in the NM_CUSTOMDRAW) anyway I think you can use int nImage=GetNextItem(-1,LVNI_SELECTED);
-
Thanks, But What i want to know is the image number associated with a subitem in listctrl. I think the above function won't help me in that.. nave
I don't think that you can get the index for a sub-item image, since the iImage member of LVITEM structure is specifically described as the index of the item's image, and not the index of the sub-item's image. Maybe you must manually store the sub-item's image index in the lParam of the item and retrieve it from there. Best, Mike