title: numeric TextBox keydown
body: <p>i want to make a TextBox numeric. The Idea is to check the pressed Key before the Text is shown in the TextBox. I implement the Method KeyDown() of the TextBox.
  Here is my Code:</p>
  
  <pre><code>private void txtX_KeyDown(object sender, KeyEventArgs e)
  {
      if (!char.IsDigit(e.KeyChar) &amp;&amp; !char.IsControl(e.KeyChar))
      {
          e.Handled = true;
      }
  }
  </code></pre>
  
  <p>KeyEventArgs has no KeyChar (I got this from a tutorial)</p>
  
  <p>I use <strong>WPF</strong></p>