title: Block Events from a Form/UserControl
body: <p>My Application sometimes comminucate with a Server in another Thread, while the form should be locked in this time(that means, the user cant fire any <code>Click</code>, <code>KeyDown</code> .... event). In this time, a waitoverlay with a loading circle is showing which blocks any mouse events like click or mousehover.<br><br>
  But the problem is, that the user can fire KeyDown events by pressing keys and the user can also make mouse clicks by pressing enter after navigating to the button with the TAB Key.
  <br><br>I know that <code>Form.Enabled = true;</code> can do the trick, but then the form is looking very ugly. I know also that I could make a <code>bool inaction;</code> and then look at this var in the event handler, but I think theres a better way.<br>
  <br>
  <strong>Short Form: How can I block GUI Events like Click or KeyDown from a Form without .Enabled = True?</strong> <br><br>
  Any help will be greatly appreciated.</p>
  
  <p><strong>Edit: Solved it by adding this to the overlay control:</strong></p>
  
  <pre><code>protected override bool ProcessKeyMessage(ref Message m)
  {
      return true;
  }
  protected override bool ProcessTabKey(bool forward)
  {
      return true;
  }
  </code></pre>