tags:

views:

388

answers:

1

C#: Is there a shortcut to detect if mouse is still hovering on top of Label on MouseHover event?

Just curious if there's a bool to check, if not to get mathematical then :(.

+2  A: 

I think math is the only route to determine if the mouse is "still" hovering, but if you subscribe to both the hover and leave events then in most cases you should be able to handle whatever you need.

    private void label1_MouseHover(object sender, EventArgs e)
    {
        //make changes for hovering
    }

    private void label1_MouseLeave(object sender, EventArgs e)
    {
        //undo changes
    }
Timothy Carter
Once again yshuditelu with a swift reply. Thank you. In that case I'll stick to the MouseEnter/MounseLeave events. Just experimenting with MouseHover but then I read the "remains stationary for an amount of time".