Windows Forms ToolTip will not re-appear after first use

后端 未结 9 1312
借酒劲吻你
借酒劲吻你 2020-12-03 13:42

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

相关标签:
9条回答
  • 2020-12-03 14:18

    I guess you'll be happy to know that Microsoft knows about it...since about 5 years...

    • 2/21/2005 Bug acknowledged as reproducable
    • 3/29/2005 Hum we might fix it, but later...
    • 11/15/2005 Well actually it's not a big bug, and it doesn't happen much, so we won't fix it.

    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...

    0 讨论(0)
  • 2020-12-03 14:26

    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.

    0 讨论(0)
  • 2020-12-03 14:26

    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.

    0 讨论(0)
提交回复
热议问题