Click here to Skip to main content
15,893,904 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I create a list control with check box property
I add event for NM_Click. Here i found that if i check/uncheck any item many items then i dont get correct value through listcontrol.GetCheck(item) method.
Please suggest how to solve it. Is there any other event which is called once list control check/uncheck is done
Posted

1 solution

You have to set handler on LVN_ITEMCHANGED event (http://msdn.microsoft.com/en-us/library/bb774845(v=vs.85).aspx[^]).
Example:
void CMFCListControlDlg::OnLvnItemchangedList2(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMLISTVIEW pNMLV = (LPNMLISTVIEW *)(pNMHDR);

	BOOL bChecked = ListView_GetCheckState(
		pNMLV->hdr.hwndFrom, pNMLV->iItem);

	*pResult = 0;
}
 
Share this answer
 
v3

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