title: Printing From WebBrowser control prints to wrong printer after setting default
body: <p>I have a WebBrowser control in a VB.NET WinForms app.  I am able to set the default printer from code and print without prompting the user.  However, there is also a print button that shows the PrintDialog.  If this action is done first the page will print.  Then if I try to programmatically print later (again setting the default printer to some other printer) the it will print to the last printer selected in the PrintDialog box even though I am resetting the default and see the default printer being changed in Windows.</p>
  
  <p>Any ideas?</p>
  
  <p>It works fine unless ShowPrintDialog has a printer chosen first.  Once that occurs it seems to always use that printer no matter what I do.</p>
  
  <pre><code>For Each strPrinter In PrinterSettings.InstalledPrinters
              If strPrinter.Contains("My Printer") Then
                  wScript.SetDefaultPrinter(strPrinter)
              End If
          Next
  
          browser.Print()
  </code></pre>