title: Blocking dialogs in .NET WebBrowser control
body: <p>I have a .NET <strong>2.0</strong> WebBrowser control used to navigate some pages with no user interaction (don't ask...long story).  Because of the user-less nature of this application, I have set the WebBrowser control's ScriptErrorsSuppressed property to true, which the documentation included with VS 2005 states will [...]"hide all its dialog boxes that originate from the underlying ActiveX control, not just script errors." The <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.scripterrorssuppressed(VS.80).aspx" rel="noreferrer">MSDN article</a> doesn't mention this, however.
  I have managed to cancel the NewWindow event, which prevents popups, so that's taken care of.</p>
  
  <p>Anyone have any experience using one of these and successfully blocking <strong>all</strong> dialogs, script errors, etc?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This isn't a standalone instance of IE, but an instance of a WebBrowser control living on a Windows Form application.  Anyone have any experience with this control, or the underlying one, <strong>AxSHDocVW</strong>?</p>
  
  <p><strong>EDIT again</strong></p>
  
  <p>Sorry I forgot to mention this... I'm trying to block a <strong>JavaScript alert()</strong>, with just an OK button.  Maybe I can cast into an IHTMLDocument2 object and access the scripts that way, I've used MSHTML a little bit, anyone know?</p>