title: MessageBoxButton.YesNo Tutorial
body: <p>I have a little problem again but this time it regards the <code>MessageBoxButton.YesNo</code>. This is my problem: I don't know what's the right syntax so that if I hit Enter(keyboard) or click Yes, the <code>Application.Exit();</code> will execute and if I hit Esc(keyboard) or  click No, the <code>Application.Exit();</code> will not execute. This is my code:</p>
  
  <pre><code>MessageBox.Show("Are you sure you want to exit?","Application Exit", MessageBoxButtons.YesNo);
  Application.Exit();
  </code></pre>