title: C# KeyChar error
body: <p>Hello everyone i made C# program and i want to make textbox only accept Number i tryed many different code and i get same errors please help 
  this is my code </p>
  
  <pre><code>    private void agetxt_Click(object sender, EventArgs e)
      {
          if (!char.IsControl(e.KeyChar) &amp;&amp; !char.IsDigit(e.KeyChar))
          {
              e.Handled = true;
          }
      }
  </code></pre>
  
  <p>and this is the error message i get</p>
  
  <p>Error   CS1061  'EventArgs' does not contain a definition for 'KeyChar' and no extension method 'KeyChar' accepting a first argument of type 'EventArgs' could be found (are you missing a using directive or an assembly reference?)   WindowsFormsApplication1    C:\Users\ziadm\Documents\Visual Studio 2015\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form2.cs 176 Active</p>