Selection in tree with right mouse button 
Author Message
 Selection in tree with right mouse button

Hi,
I have a CTreeCtrl class where I would like to be able to make selections
with the right
mouse button in the same way it is done with the left button.

I have tried to do this by calling OnLButtonDown(nFlags, point) from the
OnRButtonDown-handler
but this dosn't seem to do the trick.

Any ideas?

Thanks in advance,
Morten Moth



Tue, 03 Sep 2002 03:00:00 GMT  
 Selection in tree with right mouse button
Hi !

// I have a CTreeCtrl class where I would like to be able to make selections
with the right
// mouse button in the same way it is done with the left button.
// I have tried to do this by calling OnLButtonDown(nFlags, point) from the
// OnRButtonDown-handler but this dosn't seem to do the trick.

you can use the follwing within your OnRButtonDown() handler:

OnRButtonDown(UINT uFlags, CPoint point)
{
...
if(hItem = GetTreeCtrl().HitTest(point, &uFlags))
  GetTreeCtrl().SelectItem(hItem);
...

Quote:
}

Hope this helps !

Regards,
Hans Pesata



Tue, 03 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. [Fwd: Right mouse button and depressed button]

2. Right click selection in Tree View

3. Need sample code for tree control supporting right-mouse-click menues

4. Q: MS VC4.2 Tree Control : Selecting item with right mouse click

5. How to use the right and middle mouse buttons

6. Treeview: Right Mouse Button

7. x and y coordinates when i click right mouse button

8. Right mouse button click in CTreeView?

9. Toggling the mouse buttons from right to left

10. Select Listbox item by right (!)mouse button pressing

11. Pop up menu has my program (Right Mouse Button)

12. Right button mouse click in CListBox

 

 
Powered by phpBB® Forum Software