Windows窗体工具提示将不会再出现第一次使用后 [英] Windows Forms ToolTip will not re-appear after first use
问题描述
我有一个Windows窗体C#应用程序,我想用一个工具提示上的文本框之一。我初始化工具提示在Form类的构造函数,和它的作品第一次。所以,当我用我的鼠标在文本框中悬停它的工作原理,但一旦工具提示超时,它消失了,它不会重新出现,当我移动我的鼠标移开,并返回到控制。我希望它回来。我究竟做错了什么?
下面是我的初始化工具提示:
myTip =新的工具提示();
myTip.ToolTipIcon = ToolTipIcon.Info;
myTip.IsBalloon = TRUE;
myTip.ShowAlways = TRUE;
myTip.SetToolTip(txtMyTextBox,我的工具提示文字);
我今天也有类似的问题。有时,工具提示不显示。我有一个工具提示控制在我的窗体中的所有控件。
我也对所有自动添加控件MouseEnter事件,所以我修改了MouseEnter事件做:
_tooltip.Active = FALSE;
_tooltip.Active = TRUE;
它修复了这一错误,但我不知道为什么。
此外,错误总是发生在Windows XP计算机,但不能在Windows Vista中。
I have a Windows Forms C# application where I would like to use a tooltip on one of the text boxes. I initialize the tool-tip in the constructor of the Form class, and it works the first time. So when I hover over the text box with my mouse it works, but once the toolTip times out and it goes away, it does not re-appear when I move my mouse away and back onto the control. I would expect it to come back. What am I doing wrong?
Here is how I initialize the tooltip:
myTip = new ToolTip();
myTip.ToolTipIcon = ToolTipIcon.Info;
myTip.IsBalloon = true;
myTip.ShowAlways = true;
myTip.SetToolTip(txtMyTextBox,"My Tooltip Text");
I had a similar problem today. Sometimes, the tooltip would not show. I had one ToolTip control for all the controls in my form.
I also had a MouseEnter event on all the controls added automatically, so I modified the MouseEnter event to do:
_tooltip.Active = false;
_tooltip.Active = true;
It fixed the bug, but I don't know why.
Also, the bug always happened on Windows XP machines, but not on Windows Vista.
这篇关于Windows窗体工具提示将不会再出现第一次使用后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!