Click here to Skip to main content
15,881,743 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi guys, i need to update my list controls image. I am using Report view with LVS_EX_GRIDLINES.

I have a image list which contains 10 images. when am updating my listctrl image is not chaged..

void CProView::UpdateLogEntry(CString strEntryID)
{
	CListCtrl& list = GetListCtrl();
	LVFINDINFO lvfInfo;
	lvfInfo.flags = LVFI_STRING | LVFI_WRAP;
	lvfInfo.psz = strEntryID;
	int nPos = 0;

	if((nPos = list.FindItem(&lvfInfo)) != -1)
	{
		list.SetItem(nPos, 0, LVIF_TEXT, _T("Send"), 3, 0, 0, 0, 0);// Image 3 is not update im my clistctrl
		list.SetItemText(nPos, 4, _T("Yes"));
	}
}
Posted

1 solution

I think you just forgot the LVIF_IMAGE mask:
list.SetItem(nPos, 0, LVIF_TEXT | LVIF_IMAGE, _T("Send"), 3, 0, 0, 0, 0);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900