开发者

Windows Forms toolTip forever using C#

How do I set a toolTip that doesn't go away as long as you're hovering on the control?

I tried setting the "AutoPopDelay开发者_如何学Go" to 999999, but the tooltip disappears after 15 seconds.

Or, is there another way to achieve the same effect?


This is what worked for me:

AutoPopDelay = 32767 MSDN states this is Int32, but anything over 32767 will fail.

InitialDelay = 200

ReshowDelay = 200

This should make the tooltip be shown for as long as possible. I hope it helped.


From MSDN:

There are multiple delay values that you can set for a Windows Forms ToolTip component. The unit of measure for all these properties is milliseconds. The InitialDelay property determines how long the user must point at the associated control for the ToolTip string to appear. The ReshowDelay property sets the number of milliseconds it takes for subsequent ToolTip strings to appear as the mouse moves from one ToolTip-associated control to another. The AutoPopDelay property determines the length of time the ToolTip string is shown. You can set these values individually, or by setting the value of the AutomaticDelay property; the other delay properties are set based on the value assigned to the AutomaticDelay property. For example, when AutomaticDelay is set to a value N, InitialDelay is set to N, ReshowDelay is set to the value of AutomaticDelay divided by five (or N/5), and AutoPopDelay is set to a value that is five times the value of the AutomaticDelay property (or 5N).

For more information on this subject, look here:

  • ToolTip Class

  • Make tooltips remain visible for a very long time in Visual Basic .NET

  • Stack Overflow question Can I set an infinite AutoPopDelay for a tooltip in a .NET Windows Forms window?

  • Tooltips with infinite timeout?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜