views:

1407

answers:

2

I've created a WPF application where the title bar and chrome are turned off. I have a border around the entire app, with the idea that it would act like the chrome in some regards. The first thing I'm trying to do is have the mousemove event capture the movement of the mouse when the mouse is clicked, so that the window moves with the mouse. The problem is that if the mouse moves too quickly, it manages to leave the window and therefore the mousemove no longer fires. I've been able to do this with a normal WinForm with no problems regardless of the speed of the mouse. Is there any way to do this more efficiently, or perhaps tune the polling of the mousemove? Perhaps a different container other than border that would perform better?

+4  A: 

When the user clicks you should capture the mouse (see Mouse.Capture). That way, you'll get the mouse events regardless of whether the mouse cursor is over your element or not.

HTH, Kent

Kent Boogaart
+5  A: 

Try Me.DragMove in the window's left click event handler. It much better than most custom solutions.

Bryan Anderson
This worked great.
MasterMax1313