MFC ListControl 获取CheckBox的状态(选中or非选中)

添加LVN_ITEMCHANGED事件

void CResultPicDlg::OnItemchangedTotalshownList(NMHDR *pNMHDR, LRESULT *pResult)
{
    LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
    // TODO: Add your control notification handler code here
    NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
    CString c_str;
    if(m_totalShown_list.GetCheck(pNMListView->iItem)==1)
    {
        AfxMessageBox("选上");
    }
    else
        AfxMessageBox("没选上");
    

    *pResult = 0;
    *pResult = 0;
}

 

posted @ 2017-05-16 10:55  Henry2017  阅读(1217)  评论(0编辑  收藏  举报