When I start a drag and drop using a right click in WPF it will fire the drop on any target with out waiting for the right mouse button to come up.
Asked
Active
Viewed 1,837 times
1
-
Can you please tell us what you have tried to do so far? – Dennis Jun 30 '09 at 06:20
-
I have been using a previewMouse right and left button down event to set get a start point for each click and then on mouse move i check to see if the mouse button is still pressed and if it is over the min drag distance i start a drag drop. This all works now the problem is on the drop side of things. I added the following code to the onDrop function i have. if (e.KeyStates != DragDropKeyStates.RightMouseButton) this prevents it form going into the drop mode when I am using the right mouse button for dragging. However the cursor isn't updating when you go over a target. – Erin Jun 30 '09 at 14:46
1 Answers
2
To drag, the mouse needs to be captured, which can only be achieved when the left mouse button is down. See http://msdn.microsoft.com/en-us/library/system.windows.uielement.capturemouse(VS.95).aspx (for Silverlight, but I think it's similar).

Bruno Martinez
- 2,850
- 2
- 39
- 47