2012-01-03 53 views
16

如何在WinForms中显示IsBalloon工具提示如何显示.NET气球工具提示?

现在,我尝试:

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

不幸的是,气球没有指向(0, 0)(相对于对照),但显示了(0,0)(相对于对照):

什么是显示.NET气球工具提示的正确方法?

+0

你见过[这](http://stackoverflow.com/questions/2028466/c-set-position-of-the-arrow-在一个工具提示气球)相关的问题? – 2012-01-03 18:32:53

+0

不能从句子中清除“不幸的是,相对于控件,气球并不指向(0,0),而是相对于控件在*(0,0)*处出现。哪个控件,ToolTip或TextBox? – Sabuncu 2012-01-03 18:37:04

+0

@ M.Babcock我没有看到这个问题;尽管这个问题没有关系。 – 2012-01-03 18:53:23

回答

19

已知错误。说它两次,第一次为空:

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

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

+0

我用google搜索了一下,并且你仍然无法击败那些记得答案的人。 – 2012-01-04 14:30:48

+1

@IanBoyd请参见[工具提示气球干为第一次调用ToolTip.Show()]导向不正确(https://connect.microsoft.com/VisualStudio/feedback/details/98281/tooltip-balloon-stem-is-oriented-错误地为首先调用工具提示展示) – LarsTech 2012-01-04 14:37:29

+1

由于7年前:( – 2012-01-04 14:59:57