title: C# Adding code to FormClosing event disables X on MdiParent
body: <p>I have two background threads and a thread to handle minimization running on my WinForms Application. When the program closes, I use this method.</p>
  
  <pre><code>private void MyForm_Closing(object sender, FormClosingEventArgs e)
      {
          if(labelsUpdaterThread.IsAlive == true)
              labelsUpdaterThread.Abort();
          if(printNotifyThread.IsAlive == true)
              printNotifyThread.Abort();
          if(minimizeThread.IsAlive == true)
              minimizeThread.Abort();
      }
  </code></pre>
  
  <p>labelsUpdaterThread and printNotifyThread run all the time. MinimizeThread, as you might guess, only runs when the parent form is minimized. Here's my problem:</p>
  
  <p>When the thread.abort methods are called in my above method, the "X" on the top right of my MdiParent form doesn't do anything. Clicking it has no effect.</p>
  
  <p>When the thread.abort methods are NOT called in my above method, closing the MdiParent will sometimes throw exceptions because the Threads are still trying to access resources on the MdiParent that are no longer available, even though they are background threads!</p>
  
  <p>I'm unsure as to why this is happening, doesn't make much sense to me. Thanks in advance for any help!</p>