title: Form.ProcessDialogKey seems to give ambigious keys pressed
body: <p>Currently, I'm overriding the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.form.processdialogkey.aspx" rel="nofollow"><code>Form.ProcessDialogKey</code> method</a> inside my WinForms form to allow the user to directly select a tab page of a tab control inside the form when pressing <kbd>Alt</kbd>+<kbd>1</kbd> ... <kbd>Alt</kbd>+<kbd>9</kbd>.</p>
  
  <p>I.e. pressing <kbd>Alt</kbd>+<kbd>1</kbd> should select the first tab, <kbd>Alt</kbd>+<kbd>2</kbd> the second tab, etc.</p>
  
  <p>This is an excerpt of my code:</p>
  
  <pre><code>protected override bool ProcessDialogKey(Keys keyData)
  {
      if ((e.KeyData &amp; Keys.Alt) == Keys.Alt)
      {
         if ((e.KeyData &amp; Keys.D1) == Keys.D1) tabIndex = 0;
         else if ((e.KeyData &amp; Keys.D1) == Keys.D1) tabIndex = 0;
         else if ((e.KeyData &amp; Keys.D2) == Keys.D2) tabIndex = 1;
         else if ((e.KeyData &amp; Keys.D3) == Keys.D3) tabIndex = 2;
         // ...
      }
  }
  </code></pre>
  
  <p>I discovered that my check give redundant results. E.g. when pressing <kbd>Alt</kbd>+<kbd>3</kbd>, </p>
  
  <pre><code>(e.KeyData &amp; Keys.D3) == Keys.D3 // &lt;&lt;== TRUE.
  </code></pre>
  
  <p>is <code>true</code>, but also other checks are <code>true</code>, e.g.:</p>
  
  <pre><code>(e.KeyData &amp; Keys.D1) == Keys.D1 // &lt;&lt;== also TRUE.
  (e.KeyData &amp; Keys.D0) == Keys.D0 // &lt;&lt;== also TRUE.
  </code></pre>
  
  <p>I do think this is quite logical, since the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx" rel="nofollow"><code>Keys</code> enumeration</a> does lot of bitwise combination of other <code>Keys</code> member values.</p>
  
  <p>So I do unsertand why I get too much <code>true</code> results, I just do not know how to do a correct check.</p>
  
  <p><strong>My question:</strong></p>
  
  <p>Can I use the <code>Form.ProcessDialogKey</code> method at all to check for <kbd>Alt</kbd>+<kbd>1</kbd>...<kbd>Alt</kbd>+<kbd>9</kbd> combination or should I choose another aproach?</p>
  
  <p>(If there is another aproach, I would love to get a link to it)</p>
  
  <p><strong>Update 1:</strong></p>
  
  <p>It seems that if I revers the check order, i.e. first <code>Keys.D9</code> and then down to <code>Keys.D1</code> that the matching works better (correct?)</p>