title: Enter keyboard input in Windows Form (C#)
body: <p>I made a calculator and the only thing left to do is to make it work from keyboard input. It all works perfect untill I get to the Enter KeyDown. The problem is that when I start my calculator, a topleft button is selected and if I press Enter it will instead call the method of that specific button (number 7). It also appears that if I click any button at all, it will be selected, and same thing would happen if I press Enter.</p>
  
  <p>I tried to set my form to acceptButton = "none" and to "equal_btn" (my equal button, I want to use it when I press Enter), but it didn't help</p>
  
  <pre class="lang-cs prettyprint-override"><code>private void Form1_KeyDown(object sender, KeyEventArgs e)
          {
              switch (e.KeyCode)
              {
                  case Keys.D0:
                      btn_zero.PerformClick();
                      /*PerformClick() because all methods are for buttons*/
                      break;
                  case Keys.D1:
                      btn_one.PerformClick();
                      break;
                  case Keys.D2:
                      btn_two.PerformClick();
                      break;
                  /*......*/
                  case Keys.Oemplus:
                      plus.PerformClick();
                      break;
                  case Keys.Enter:
                      equal.PerformClick();
                      break;
              }
          }
  </code></pre>
  
  <p>What I expect is to when I press Enter, the button Equal method will be called. Instead as said before it calles only sellected buttons.
  Btw all other buttons work perfectly.</p>
  
  <p>(hope I didn't miss anything on StackOverflow, otherwise sorry)</p>