title: Get KeyCode value in the KeyPress event
body: <p>How to fix this error:</p>
  
  <blockquote>
    <p>'System.Windows.Forms.KeyPressEventArgs' does not contain a definition
    for 'KeyCode' and no extension method 'KeyCode' accepting a first
    argument of type 'System.Windows.Forms.KeyPressEventArgs' could be
    found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>private void Form1_KeyPress(object sender, KeyPressEventArgs e)
  {
       if (e.KeyCode == Keys.Enter)
       {
           MessageBox.Show("Enter Key Pressed ");
       }
  }
  </code></pre>
  
  <p>I'm using Visual studio 2010, framework 4 for this project.</p>