title: WinForms Validation Without Hanging Other Controls
body: <p>So, I got this problem in WinForms, at least I think its a problem, and I can't figure out how to resolve it.</p>
  
  <p>Basically, when I implement a <code>Validating</code> event handler for a control, I set the <code>CancelEventArgs.Cancel</code> to true when the control fails its validation. Example code:</p>
  
  <pre><code>private void NameTextBox_Validating(object sender, CancelEventArgs e) {
      // Assume Cool Validation Logic.
      //
      // ...
      var isValid = false;
      if (!isValid) {
          e.Cancel = true;
  
          // Set an Error Provider Message.
          //
          // ...
      }
  }
  </code></pre>
  
  <p>This cause the entire UI to hang. I can't select any other control, minimize the parent form window, or event exit the parent form window. So I found a similar question whose answer suggests implementing a <code>FormClosing</code> event handler for the parent form and set <code>FormClosingEventArgs.Cancel</code> to false there.</p>
  
  <p>Problem is, that event handler is never being called as long as my control is invalid. I have a feeling it might have something to do with my control hierarchy, though I am not 100% sure. If that helps here it is:</p>
  
  <pre><code>-- Parent Form
  
  ---- Custom User Control
  
  ------ Text Box Control (&lt;-- Causes Hang)
  </code></pre>
  
  <p>Any thoughts would be appreciated.</p>