title: How to display current URL into textbox on a tabbed browser?
body: <p>I have already tried</p>
  
  <pre><code>TextBox1.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Url.ToString
  </code></pre>
  
  <p>But I get back:</p>
  
  <pre><code> Object reference not set to an instance of an object.
  </code></pre>
  
  <p>I've done some debugging, and i can write the url to the debug terminal, but it seems i can't make anything equal CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Url.ToString</p>
  
  <p>EDIT:
  I have solved this issue</p>
  
  <p>Put This Into Your Form Load:</p>
  
  <pre><code>AddHandler wb.DocumentCompleted, AddressOf WebBrowser1_DocumentCompleted_1
  </code></pre>
  
  <p>Then Put This Into Your Code:</p>
  
  <pre><code>Private Sub WebBrowser1_DocumentCompleted_1(sender As Object, e As WebBrowserDocumentCompletedEventArgs)
      TextBox1.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Url.ToString
  End Sub
  </code></pre>