Changing the time it takes for the mousehover event to fire

流过昼夜 提交于 2019-12-11 20:37:27

问题


I'm making a winforms C# project with .NET 4.

I want to display a tooltip when the mouse hovers over a button or a textbox or whatever. Right now it displays almost as soon as the mouse stops moving. I don't like this. I want it to have more of a delay.

Is there any way I can set a mousehover event delay time that is the same for all installed users?

I suppose I could start a timer, and then cancel the timer when the mouse moves again but there's got to be a better way by golly!


回答1:


Try this I think it will really help You

 ToolTip t = new ToolTip();
 t.InitialDelay = 500;
 t.SetToolTip(button1, "Hello");



回答2:


You can use the InitialDelay property of the Tooltip to insert a delay. Check here: http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.initialdelay.aspx




回答3:


You could experiment with SystemInformation.MouseHoverTime property. I suppose it's system-wide



来源:https://stackoverflow.com/questions/4130476/changing-the-time-it-takes-for-the-mousehover-event-to-fire

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!