2013-02-24 165 views
0

好吧,所以我有一個基本的Web瀏覽器項目(後退/前進按鈕,停止/刷新以及所有必需的組件)。我正在使用工具箱中提供的Webbrowser對象。我怎樣才能讓鼠標懸停在瀏覽器內部的鏈接上,它將鏈接顯示爲表單上標籤上的字符串(即狀態標籤以告知鼠標懸停在哪個URL上)。用於檢測鼠標懸停在URL上的鼠標事件

+0

我編輯了你的標題。請參閱:「[應該在其標題中包含」標籤「](http://meta.stackexchange.com/questions/19190/)」,其中的共識是「不,他們不應該」。 – 2013-02-24 00:16:02

+0

可能這個(http://stackoverflow.com/questions/8309049/how-to-get-mouse-over-event-to-link-button-from-client-side)派上用場朋友 – 2013-02-24 07:56:39

回答

0
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted 
     AddHandler WebBrowser1.Document.MouseOver, AddressOf Me.DisplayHyperlinks 
    End Sub 

Public Sub DisplayHyperlinks(ByVal sender As Object, ByVal e As System.Windows.Forms.HtmlElementEventArgs) 
     TextBox4.Text = e.ToElement.GetAttribute("href") 
    End Sub