title: Form is closing on message box button click
body: <p>I am facing a strange problem, I am showing a message box with yes|no buttons, but whenever any of the button on message box is clicked it closes the form also.</p>
  
  <p>I thought it is something related to my code so I tried only this much code on my button click </p>
  
  <pre><code>if(MessageBox.Show("Are you sure you want to delete this category?", "Delete Category",
                      MessageBoxButtons.YesNo, 
                      MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) 
                      == DialogResult.Yes)
   {
       // doing nothing just to check
   }
  </code></pre>
  
  <p>But that is also closing the form. </p>
  
  <p>I tried putting button in different places, tried adding different buttons etc but nothing is working.</p>
  
  <p>Is there anything I can try or could be the reason?</p>