French Boy
French Boy

Reputation: 1491

Can I know in an instant whether there is a component is dragging over a control or not

Can I know in an instant whether there is a component is dragging over a control or not?.

I know that I can catch it via DeagEnter and DragLeave events, but I want a flag in an instant to give me this information.

If there isn't then, I'll create my own flag, but the problem is that I'm afraid that this value isn't true always for some reason like moving the mouse quickly or an exception and a wrong value keeps in the control.

Any idea?

Upvotes: 0

Views: 58

Answers (1)

Hans Passant
Hans Passant

Reputation: 941545

No, there are no guarantees that passing the cursor quickly over an window will trigger any of the window's events. The mouse position is reported periodically, not for every pixel it traverses.

This is not normally much of a problem. But it can byte when you rely on the MouseEnter and MouseLeave event for example with a control that is close to the edge of its container. It is a non-issue with drag+drop, the user will easily see that the mouse cursor shape isn't changing and correct for that. The visual feedback is sufficient.

Upvotes: 1

Related Questions