title: WebBrowser Control Navigation Not Working Windows 10
body: <p>I have an app that requires navigating to some sites, clicking some buttons/links to navigate and eventually download files directly.</p>
  
  <p>I tried to use the selenium Firefox Driver, but this keeps breaking every time firefox gets an update. </p>
  
  <p>I decided to use WebBrowser Control instead and I checked all the examples online but for some reason the navigation is not happening and the Documentcompleted event is not firing.</p>
  
  <p>I created a simple Windows Form to test the app and put the control in it, it is visible. When the code hits the Navigate method, it gets stuck because it never executes the DocumentCompleted event. I tried to remove the wait method but the document in the WebControl remains null and the DocumentCompleted is never executed. The breakpoint in the Documentcompleted is never hit (I put the breakpoint at the if level)</p>
  
  <p>I am using Visual Studio 2015, I have Windows Pro 10 installed. I also have both IE 11 and Edge but my default browser is Chrome. (I don't think this uses Chrome)
  The Windows app is running .NET 4.5.2</p>
  
  <p>The client is also running windows 10. I read some replies about potential issues with Windows 10 updates and to change the registry or uninstall certain updates, but I really don't want to go this route. Any ideas or alternative?</p>
  
  <p>Here is the form code behind
  The page I am navigating to, is public and no login is required.</p>
  
  <pre><code>  public partial class WebBrowserForm : Form
    {
  
          bool pageLoaded = false;
  
          public WebBrowserForm()
          {
              InitializeComponent();
          }
  
          public void TestDownload()
          {
              WebBrowser browser = new WebBrowser();
              browser.Visible = true;
              browser.AllowNavigation = true;
  
              pageLoaded = false;
              browser.DocumentCompleted += Browser_DocumentCompleted;
              browser.Navigate("http://apps.ahca.myflorida.com/dm_web/");
              waitForPageLoading();
                  //do something else here once the page is loaded
  
          }
  
          private void Browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
          {
              if ((sender as WebBrowser).ReadyState == System.Windows.Forms.WebBrowserReadyState.Complete)
              {
                  pageLoaded = true;
              }
          }
  
  
          void waitForPageLoading()
          {
              while (pageLoaded == false)
              {
                  Thread.Sleep(3000);// keep sleeping until the page is ready   
              }
          }
  
          private void btnTest_Click(object sender, EventArgs e)
          {
              TestDownload();
          }
      } 
  </code></pre>