title: MessageBox without a default button
body: <p>I have a form in my application where users can enter a list of serial numbers, each to be subjected to a quick check and then added to a list (this is for a stock take module). So the users typically use barcode scanners to scan the serial numbers from a pile of stock items.</p>
  
  <p>I'm handling the <code>KeyPress</code> event of the <code>TextBox</code> that has focus while the users are scanning items and look for <code>e.KeyChar == 13</code> (the enter key). Whenever enter is pressed, I know that I have a complete serial number which I can then validate before adding it to the list.</p>
  
  <p>Here's where my problem occurs; Under certain conditions, I have to prompt the user at this point on whether he really wants the stock item added to the list or not. I'm using a <code>MessageBox</code> for that, like so:</p>
  
  <pre><code>if (MessageBox.Show("This is a special stock item.\r\nDo you want to add it to the list?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     // Add item to list
  else
     // Do not add item to list
  </code></pre>
  
  <p>But because this is something that only happens occasionally, the users often don't even see the <code>MessageBox</code> and simply scans the next serial number, which gets lost of course but which ends with an enter key, which fires the default button on the <code>MessageBox</code> and without having intended to do so, and sometimes not even aware that it's happened, the user adds an item to the list and misses a subsequent item.</p>
  
  <p><strong>Is there a way I can prevent the <code>MessageBox</code> from firing any buttons if enter is pressed?</strong> I don't mind if the user goes on scanning barcode after barcode and losing them all, as long as the <code>MessageBox</code> remains on screen until he realises his attention is required and deliberately select one of the two options.</p>