Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Trouble With Mouse Events and Dragging an Element.

$
0
0

Hello

I want to drag some elements on a Canvas and am using this DraggableExtender code as the basis for my solution:DraggableExtender.

Essentially it appears to attach PreviewMouseUp, PreviewMouseDown and PreviewMouseMove event handlers to the element clicked on and when the mouse is moving the element has it's Canvas.Left and Canvas.Top values set to follow the mouse.

It works up to a point but I find that If I move the mouse quickly the mouse is no longer over the element, the handlers stop handling and it is then difficult to regain control of the Element.

In the PreviewMouseDown handler I have added a Mouse.Capture call to try and improve the usability but it doesn't seem to help.

Does anyone have any suggestions please?

Regards

Chris


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>