Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MFC (http://www.go4expert.com/forums/mfc/)
-   -   Checkbox with CListCtrl (http://www.go4expert.com/forums/checkbox-with-clistctrl-t10289/)

rag84dec 29Apr2008 14:45

Checkbox with CListCtrl
 
Hi,
here is my code
Code:

OnCheckboxChanged
( NMHDR*                  pNMHeader,
  LRESULT*                pResult )
{
       
       
        CListCtrl* a_pStatus = (CListCtrl*) GetDlgItem(IDC_DLG_FWUPDATE_FILES_LOCALFILES);
        NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHeader;
        LVHITTESTINFO hitinfo;

//Get the current element item selected.
        hitinfo.pt = pNMListView->ptAction;

//Make the hit test...
        OC_ULong_t item = a_pStatus->HitTest(&hitinfo);

        if ((IsChecked(pNMListView->uNewState)))
                a_pStatus->SetCheck(item,false);
//*pResult = 0;
  if((IsChecked(pNMListView->uNewState))&&(m_FWInfo.size() != 0))
  GetDlgItem(IDC_BUTTON_DETAILS)->EnableWindow(true);
  else
  GetDlgItem(IDC_BUTTON_DETAILS)->EnableWindow(false);


}

What is am doing is Enabling the "IDC_BUTTON_DETAILS" button only if one checkbox is set.Can any one tell me other way of doing this?...I want the check box to be set only if mouse is clicked on the checkbox not on the text of the cell which has the check box.... Can anyone please help????


All times are GMT +5.5. The time now is 05:46.