title: Stop the Enter Key from Firing on a WinForm
body: <p>I have a basic custom dialog box for use with various controls in a WinForms application. The dialog looks like: </p>
  
  <p><img src="https://i.stack.imgur.com/zswcB.png" alt="The custom dialog"></p>
  
  <p>For various reasons I do not want the user to have the ability to use the <code>Enter</code> key to select the 'Yes' option (<code>buttonYes</code>). Previously I did want this behaviour and I set the <code>AcceptButton</code> property of the Yes button (<code>buttonYes</code>) accordingly. I have scince removed this, setting <code>buttonYes</code>'s <code>AcceptButton</code> property to 'None', but the form still fires the <code>buttonYes.Click</code> event when the <code>Enter</code> key is pressed. I have also tried to handle the <code>KeyPress</code> or <code>KeyDown</code> events but these are not being fired when the <code>Enter</code> key is used. This is basic and annoying, has anyone come across this and what can I do to implement the functionality I want?</p>