2012-01-03 70 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