Alex Rivera | Logout

Multiple MouseHover events in a Control

Asked 2009-05-01T02:08:09.773
10

I'm trying to implement a custom control in C# and I need to get events when the mouse is hovered. I know there is the MouseHover event but it only fires once. To get it to fire again I need to take the mouse of the control and enter it again.

Is there any way I can accomplish this?

Edit
Report

1 Answer

2

Why not subscribe to the MouseMove events in the MouseHover event, then unsubscribe in the MouseLeave event

Edit:

One way to determine if the mouse is stopped would be to start a timer every time you get a mouse move event, when the timer has elapsed then you could consider the mouse stopped. The reason for removing the MouseMove events on MouseLeave would allow you to only receive events while the mouse is over your control.

answered 2009-05-01T02:30:23.213

Your Answer