(Q) Detecting right click in a CListBox 
Author Message
 (Q) Detecting right click in a CListBox
How would I go about doing this?  Should I subclass the CListBox, or can
I do it by some other means?

Is there any text on this?  I looked through MSDN, but that's become
almost useless...



Sat, 24 Nov 2001 03:00:00 GMT  
 (Q) Detecting right click in a CListBox
Override On_Context_menu:

BEGIN_MESSAGE_MAP(CMyListCtrl, CListCtrl)
 ON_WM_CONTEXTMENU()
END_MESSAGE_MAP()

afx_msg void CMyListCtrl::OnContextMenu( CWnd* pWnd, CPoint point)
{

Quote:
}

There are other methods but this is a standard way of doing it.

--
Ajay Kalra

Quote:

>How would I go about doing this?  Should I subclass the CListBox, or can
>I do it by some other means?

>Is there any text on this?  I looked through MSDN, but that's become
>almost useless...



Sat, 24 Nov 2001 03:00:00 GMT  
 (Q) Detecting right click in a CListBox
Another way would be too catch the NM_RCLICK Message:

ON_NOTIFY(NM_RCLICK , IDC_MY_LIST, OnRClickMyList)

VL.


Quote:
> Override On_Context_menu:

> BEGIN_MESSAGE_MAP(CMyListCtrl, CListCtrl)
>  ON_WM_CONTEXTMENU()
> END_MESSAGE_MAP()

> afx_msg void CMyListCtrl::OnContextMenu( CWnd* pWnd, CPoint point)
> {

> }

> There are other methods but this is a standard way of doing it.

> --



Sun, 25 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Right-click in CListBox

2. Handling a right click message in a CListBox box control

3. Right button mouse click in CListBox

4. can clistbox respond to right click

5. Detect left vs. right click event

6. Detect right click on CHeaderCtrl

7. problems detecting a right-click even on a rich edit control

8. How to detect Right Click

9. Help: Detect when right button is clicked above a button

10. Detecting right click over dialog button.

11. CListBox and Right Mouse button

12. Multi CListBox using double-click selection

 

 
Powered by phpBB® Forum Software