title: Can't stop form closing when background worker is in progress
body: <p>I have a form with a background worker in a c# winforms application (Visual Studio 2010, .net 4). When the background worker is busy I would like to warn the user aboout it when tries to close the form and cancel form closing. I'd like to handle it in form closing event by setting form close cancellation to true. </p>
  
  <p>BUT it still closes the form! </p>
  
  <p>Here is the code snippet I use:</p>
  
  <pre><code>private void FormDrivenDistance_FormClosing(object sender, FormClosingEventArgs e)
  {
    if (myBackgroundWorker.IsBusy)
    {
       Messenger.ShowCriticalMessage("Don't close, in progress!");
                      e.Cancel = true;
    }
  } 
  </code></pre>
  
  <p>Where is the bug?!</p>
  
  <p>Thanks in advance!</p>