Check URL

I have coded a small tabbed browser, im just wondering how would i be able to show the URL of the specified tab in a textbox. Like the current URL. I dont want to be able to input a URL just get the URL of the window so that I can compare it in a case statement. Thanks in advance, Andrew

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim tx As New WebBrowser

Me.KeyPreview = True

TabControl1.TabPages.Add(z)

tx.Dock = DockStyle.Fill

Me.TabControl1.TabPages(Me.TabControl1.TabPages.Count - 1).Controls.Add(tx)

End Sub

Private Sub Form1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown

Dim tx As New WebBrowser

If e.KeyCode() = Keys.PageUp Then

TabControl1.TabPages.Add(z)

tx.Dock = DockStyle.Fill

Me.TabControl1.TabPages(Me.TabControl1.TabPages.Count - 1).Controls.Add(tx)

End If

If e.KeyCode() = Keys.PageDown Then

TabControl1.TabPages.Remove(TabControl1.SelectedTab)

End If

End Sub



Answer this question

Check URL

  • pavc

    This example does not necessarily follow your code:

    Private Sub WebBrowser1_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated

    TabControl1.SelectedTab.Text = WebBrowser1.Url.ToString

    End Sub



  • Check URL