How to fix the event delay

前端 未结 2 824
余生分开走
余生分开走 2020-12-11 12:38

I\'m making a table reservation system for a school project, and I\'m using a list of PictureBoxes to represent the tables. To these PictureBoxes I have linked a hover event

2条回答
  •  抹茶落季
    2020-12-11 12:55

    everything works great, except that when i haver the mouse over, it takes 1 second before the event is triggered

    That's how Control.MouseHover is defined:

    Occurs when the mouse pointer rests on the control.

    The "rests" part is the delay of a second. I don't know of any way of adjusting the length of time that the mouse has to rest of a control before it counts as a hover.

    If you don't want any delay - i.e. you want an event which is raised as soon as the mouse enters the region of the control - you should be using Control.MouseEnter instead.

    From the documentation of both events:

    Mouse events occur in the following order:

    • MouseEnter

    • MouseMove

    • MouseHover / MouseDown / MouseWheel

    • MouseUp

    • MouseLeave

提交回复
热议问题