文件名称:选中ListCtrl中的Checkbox并以高亮显示
文件大小:25KB
文件格式:DOC
更新时间:2014-01-06 08:58:10
ListCtrl
选中ListCtrl中的Checkbox并以高亮显示 void CAlarmType::OnLvnItemchangedTypelist(NMHDR *pNMHDR, LRESULT *pResult) { // TODO: 在此添加控件通知处理程序代码 NM_LISTVIEW* pNMListView=(NM_LISTVIEW*)pNMHDR; if (pNMListView->iItem != -1) { if ((pNMListView->uOldState & INDEXTOSTATEIMAGEMASK(1)) && (pNMListView->uNewState & INDEXTOSTATEIMAGEMASK(2))) { m_lstRole.SetItemState(pNMListView->iItem, LVIS_SELECTED, LVIS_SELECTED); } else if ((pNMListView->uOldState & INDEXTOSTATEIMAGEMASK(2)) && (pNMListView->uNewState & INDEXTOSTATEIMAGEMASK(1))) { m_lstRole.SetItemState(pNMListView->iItem, 0, LVIS_SELECTED); } } *pResult=0; }