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 wo
I guess you'll be happy to know that Microsoft knows about it...since about 5 years...
Damn I love it when I stumble on bugs Microsoft doesn't want to solve! This time it's called a corner case, last time it was simply too difficult to resolve...
http://connect.microsoft.com/VisualStudio/feedback/details/115385/tooltip-stop-showing-after-autopopdelay
I'm off to tell my client that the bugs in my program are just corner cases and too difficult to resolve...
I solved this problem by this
if (t == null)
{
t = new ToolTip();
}
t.IsBalloon = true;
t.ToolTipTitle = "Stop";
t.ToolTipIcon = ToolTipIcon.Error;
t.Show("", yourControlonWhichToApplyToolTip, 0);
t.Show("PDescription", yourControlonWhichToApplyToolTip, 1000);
Note i have added an empty tooltip.
For what it's worth, I was having this problem on my Windows XP system until I noticed that if I placed at least one tooltip control on my form manually (from the toolbox) I could create as many tooltips as needed within my code, and they would all work.
If, however, I tried to create all tooltips in code (say for instance in the formload event) the tips would only show once and never to be seen again. I can't give you the exact "why this happens" story, but I have duplicated this issue several times always with the same effect. It might have something to do with the object scope, but I'm not sure.
So now just as a habit, I always include at least one Visual Studio tooltip control and then the rest within my code.