C
C
crescent2019-03-29 18:26:02
WPF
crescent, 2019-03-29 18:26:02

Why is wpf mousemove not firing?

There is a canvas: there are 3 mousemove events on it. mousedown, mouseup
There are buttons inside the canvas.
I want to move these buttons like drug&drop
when I just move the mouse - mousemove event is called
but if I click on the button and move on the canvas mousemove is not called until I call mouseup event
How to fix this and why is this behavior happening?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cyber_roach, 2019-04-01
@crescent

That's right, this is how it should work, this is a standard interaction of components not only in WPF.
After a mousedown on a button, the mouse is considered to belong to this object, so the rest of the UI does not react to it.
Specifically for your task, under drug-drop there is a Drag Over event - a reaction to the pressed mouse button dragging the drug object over another object (an exception to the situation described above). Usually, the reaction is done so that the user understands where the object can be "dropped" and where it cannot, but it can be used in other cases as well.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question