title: Catching MessageBox result
body: <p>I'm trying to get the user to confirm if they want to delete a product using a MessageBox and catching its result. This is my code:</p>
  
  <pre><code>// Confirm if the user really wants to delete the product
  DialogResult result = MessageBox.Show("Do you really want to delete the product \"" + productName + "\"?", "Confirm product deletion", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
  if (result == DialogResult.OK)
  {
      MessageBox.Show("deleted");
  }
  </code></pre>
  
  <p>When I run the code and try to delete a product, deleted never shows. On the MSDN page it says to use <code>MessageBoxResult</code> rather than <code>DialogResult</code> but Visual Studio doesn't recognise <code>MessageBoxResult</code>, and I use <code>DialogResult</code> elsewhere in my code for an open file dialog. Obviously, that's not the proper way to check it.</p>