How to make child control handle accelerator command of parent CView?
-
Hi all, I have a CFormView, and a child CListCtrl control. I can handle accelerator events, like Ctrl+C, Ctrl+V ... in CFormView without problem, by defining below message handler: ON_COMMAND(ID_EDIT_COPY, &CMyFormView::OnEditCopy) Now I want my CListCtrl handle these commands differently. I want to implement OnEditCopy in CListCtrl class, rather than implement logic in the view class. How can I pass the accelerator events from CView to child control, when CListCtrl is on focus? I tried like: ON_CONTROL_REFLECT(ID_EDIT_COPY, &ThisClass::OnEditCopy) But it does not work.
-
Hi all, I have a CFormView, and a child CListCtrl control. I can handle accelerator events, like Ctrl+C, Ctrl+V ... in CFormView without problem, by defining below message handler: ON_COMMAND(ID_EDIT_COPY, &CMyFormView::OnEditCopy) Now I want my CListCtrl handle these commands differently. I want to implement OnEditCopy in CListCtrl class, rather than implement logic in the view class. How can I pass the accelerator events from CView to child control, when CListCtrl is on focus? I tried like: ON_CONTROL_REFLECT(ID_EDIT_COPY, &ThisClass::OnEditCopy) But it does not work.