title: How do I check whether a key was pressed and then do something with the value?
body: <p>I wanted to check if a key was pressed in a form, then perform a subroutine with that key. The code below works only if there are no other controls in the form. What should I do?</p>
  
  <pre><code>Private Sub MainForm_KeyPress1(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
      MsgBox(e.KeyChar)
  End Sub
  </code></pre>