WPF MouseMove Poll

I created a WPF application in which the title bar and chrome are disabled. I have a border around the entire application, with the idea that it will act like chrome in some ways. The first thing I'm trying to do is make the mousemove event capture the mouse movement when the mouse is clicked so that the window moves with the mouse. The problem is that if the mouse moves too fast, it manages to leave the window, and therefore mousemove no longer works. I was able to do this using regular WinForm without any problems, regardless of mouse speed. Is there a way to do this more efficiently, or maybe set up a mousemove poll? Perhaps a different container other than the border will work better?

+3
source share
2 answers

Try Me.DragMove in the left click event handler. This is much better than most custom solutions.

+7
source

When the user clicks, you must grab the mouse (see Mouse.Capture ). This way you will receive mouse events regardless of whether the mouse cursor is over your element or not.

+4
source

Source: https://habr.com/ru/post/1704333/


All Articles