title: How to handle KeyDown in VB.NET
body: <p>Ok here's my dilemma. here's this code I have: </p>
  
  <pre><code>   If e.KeyCode = Keys.A Then
          TextBox1.AppendText("C, ")
          PictureBox2.Visible = True
          My.Computer.Audio.Play(My.Resources.C, AudioPlayMode.Background)
     End If
  </code></pre>
  
  <p>Now when I enter this under Form1_KeyDown, visual basic thinks this:</p>
  
  <p>'KeyCode is not a a member of 'System.EventArgs' </p>
  
  <p>Now I've seen this code work before, but it isn't here. Any help?</p>
  
  <p>Here's the full code:</p>
  
  <pre><code>Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
      If e.KeyCode = Keys.A Then
          TextBox1.AppendText("A, ")
          PictureBox2.Visible = True
          My.Computer.Audio.Play(My.Resources.C, AudioPlayMode.Background)
      End If
      If e.KeyCode = Keys.S Then
          TextBox1.AppendText("C,")
          PictureBox14.Visible = True
          My.Computer.Audio.Play(My.Resources.D, AudioPlayMode.Background)
      End If
  End Sub
  </code></pre>