C# – Windows Forms ToolTip will not re-appear after first use

cnettooltipwinforms

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");

Best Answer

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.