Originally Posted by
hopefordope
hello i am making a web browser and i wanted to know that how do i get the link of an object (it shows the link in a label) when my mouse hovers over it .
thanks
Right now Web-Browser active X does not supports returning links when mouse is hovered on them. However, by using Regex expressions, you can extract all the H-Ref Links. If you want to extract them then add a listbox to the form, name it L and then use the following code on the browser's document_Completed event. The code as a whole will be then:
Code:
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Dim matchlinks As String = "]*?HREF\s*=\s*[""']?([^'"" >]+?)[ '""]?[^>]*?>"
Dim val As String = Regex.Match(WebBrowser1.DocumentText, matchlinks, RegexOptions.IgnoreCase).Value
If Not l.Items.Contains(val) Then
l.Items.Add(val)
End If
End Sub
This is all I can think of right now !!