title: Catching and handling Web Browser Close Event
body: <p>I am Using Windows Forms and a WebBrowser Control, I am in need of catching and handling the WebBrowser Controls call to close.</p>
  
  <p>I have looked at this but it is not working as I need it to: <a href="http://blogs.artinsoft.net/Mrojas/archive/2009/05/21/Extended-WebBrowser-Control-Series-WebBrowser-Control-and-windowClose().aspx" rel="nofollow">http://blogs.artinsoft.net/Mrojas/archive/2009/05/21/Extended-WebBrowser-Control-Series-WebBrowser-Control-and-windowClose().aspx</a></p>
  
  <p>This is the message I get:</p>
  
  <pre><code>---------------------------
  Web Browser
  ---------------------------
  The webpage you are viewing is trying to close the window.
  
  Do you want to close this window?
  ---------------------------
  Yes   No   
  ---------------------------
  </code></pre>
  
  <p>I need to catch this event and suppress it, then perform a function after that. Does anyone know a simple way to do this?</p>