title: Problems Detecting Alt Key on the Control.KeyUp event
body: <p>I have a control with KeyDown and KeyUp events as shown below. The problem I am having is that 'x' is TRUE in KeyDown but always FALSE in KeyUp. I am trying to detect the Alt key (as you may have guessed).</p>
  
  <p>Is there a gottcha that I don't know. I mean, when I press Alt it detects it ok but on keyup it's false.</p>
  
  <p>Any suggestions/ideas</p>
  
  <p>Thanks</p>
  
  <pre><code>    private void MyControl_KeyDown(object sender, KeyEventArgs e)
      {
          bool x;
          x = ((int) (e.KeyData &amp; Keys.Alt) != 0);
          x = (e.KeyData &amp; Keys.Alt) == Keys.Alt;
          x = e.Alt;
      }
      private void MyControl_KeyUp(object sender, KeyEventArgs e)
      {
          bool x;
          x = ((int) (e.KeyData &amp; Keys.Alt) != 0);
          x = (e.KeyData &amp; Keys.Alt) == Keys.Alt;
          x = e.Alt;
      }
  </code></pre>