18

How do i show an IsBalloon ToolTip in WinForms?

Right now i try:

ToolTip hint = new ToolTip();
hint.IsBalloon = true;
hint.ToolTipCaption = "Hello, world!";
hint.ToolTipIcon = ToolTipIcon.Error;
hint.Show("Please create a world.", myTextBox, 0, 0);

Unfortunately the balloon doesn't point to (0, 0) (relative to the control), but shows up at (0,0) (relative to the control):

What is the correct way to show a .NET Balloon ToolTip?

Teja
  • 1,236
  • 12
  • 27
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
  • Have you seen [this](http://stackoverflow.com/questions/2028466/c-set-position-of-the-arrow-in-a-tooltip-balloon) related question? – M.Babcock Jan 03 '12 at 18:32
  • Not clear from the sentence "Unfortunately the balloon doesn't point to (0, 0) relative to the control, but shows up at *(0,0)* relative to the control." Which control, ToolTip or TextBox? – Sabuncu Jan 03 '12 at 18:37
  • @M.Babcock i had not seen that question; although that question's unrelated. – Ian Boyd Jan 03 '12 at 18:53

2 Answers2

23

Known bug. Call it twice, first empty:

toolTip.Show(string.Empty, myTextBox, 0);
toolTip.Show("Please create a world.", myTextBox);

From How do I make a tooltip point at a specific label in C#?

Community
  • 1
  • 1
LarsTech
  • 80,625
  • 14
  • 153
  • 225
  • 1
    i had googled, and googled, and you still can't beat someone who remembers the answer. – Ian Boyd Jan 04 '12 at 14:30
  • 1
    @IanBoyd See [ToolTip balloon stem is oriented incorrectly for first invocation of ToolTip.Show()](https://connect.microsoft.com/VisualStudio/feedback/details/98281/tooltip-balloon-stem-is-oriented-incorrectly-for-first-invocation-of-tooltip-show) – LarsTech Jan 04 '12 at 14:37
-2

Your last line should be. Mouse_hove Action.

Answer hint.Show("Hello", Me, Me.PointToClient(New Point(0, 0)), 5000) '------------------------