Is it possible to retrieve the link that user clicked on the WebBrowser Control
Printable View
Is it possible to retrieve the link that user clicked on the WebBrowser Control
Use the "Navigating event"
ex:
Code:Private Sub WebBrowser1_Navigating(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
somestring = e.Url
End Sub
vb Code:
Private Sub WebBrowser1_Navigating(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating somestring = e.Url End Sub
when the browser gets _blank returned, it seems to have no effect
It not supposed to. What is it supposed to tell you when theres nothing to go to? It only shows when ur navigating and the page your navigation to and from, take what i used here for an example:
vb Code:
Private Sub WebBrowser1_Navigating(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating Label2.Text = "Transferring data from " & WebBrowser1.Url.ToString & " ( Port:" & WebBrowser1.Url.Port & " )" End Sub
If i go to google it shows transferring data from google.com and if i go to a next page it shows transferring data from google then transferring data from the site im going to.