Why are MouseEnter and MouseLeave unreliable?

In accordance with this question begins with "The MouseEnter/Leave events are too unreliable to do this."

what it is that makes these events are unreliable?

+3


source to share


2 answers


The mouse position is only polled so often. It is very possible that one of these events - mice entering or exiting - could occur between polls occurring and the events would not fire correctly.



It also makes a pretty specific assumption that mouse movement will be continuous rather than discrete - what if the user has a touchscreen? What if the mouse comes directly from inside the control, outside of it, without any movement between them?

+4


source


You completely missed the point. These events are unreliable for the OP's question and not in general.
The question was to see if it is cursor

inside the forms client area

. Having a lot of controls is MouseEnter/Leave

unreliable because you will receive these events even if you are inside a form area.



+2


source







All Articles