title: If webbrowser navigates to a certain URL then do this? VB
body: <p>I've looked everywhere for this! All I need to do is:</p>
  
  <pre><code>If the webbrowser's url = "http://www.example.com" then 
     CheckBox1.CheckState = CheckState.Checked 
  end if
  </code></pre>
  
  <p>thanks.</p>
  
  <p>.... later on I found the answer:
  I finally found the answer:</p>
  
  <pre><code>If WebBrowser1.Url.ToString = "http://www.example.com" Then
          do something
  End If
  </code></pre>
  
  <p>This must be in the webbrowser document completed sub:</p>
  
  <pre><code>    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
  
      End Sub
  </code></pre>
  
  <p>so all in all, the answer in full is:</p>
  
  <pre><code>Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As   System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted   
  
     If WebBrowser1.Url.ToString = "http://www.example.com" Then
          do something
     End If
  
  end sub
  </code></pre>