2014-07-25 29 views
1

我爲WebBrowser控件分配了ToolTip值,但工具提示未顯示。爲什麼ToolTip不顯示在WebBrowser控件中?

// Create the ToolTip and associate with the Form container. 
ToolTip toolTip2 = new ToolTip(); 

// Set up the delays for the ToolTip. 
toolTip2.AutoPopDelay = 5000; 
toolTip2.InitialDelay = 3000; 
toolTip2.ReshowDelay = 500; 

// Force the ToolTip text to be displayed whether or not the form is active. 
toolTip2.ShowAlways = true; 

// Set up the ToolTip text for the Button and Checkbox. 
toolTip2.SetToolTip(this.WebBrowser1, "My Web Browser"); 
+0

瀏覽器中彈出的工具提示是否會影響您嘗試顯示的網站? –

+0

我會在瀏覽器中顯示一個工具提示干擾網站 – user3501155

+0

咦?這並不是很清楚。如果你加載一個網站,它將會有鏈接和圖片等等,其中任何一個都可能導致瀏覽器顯示文本(通過標題,alt等)。那麼你的工具提示何時應該顯示? –

回答

1

要顯示的工具提示必須是HTML頁面的一部分。您使用Title屬性。例如:

<p><abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p> 

<a title="Click on me" href="http://blah" target="_self">I am a link</a> 

當您將鼠標懸停在其上時,WebBrowser控件將自動顯示您的工具提示。

相關問題