Cancel a click event in ShowDialog form
<p>I am displaying a form using <code>xForm.ShowDialog(this);</code>.</p>

<p>This form has a button which has its <code>DialogResult</code> set to OK. Now when I click on the OK button, there is some validation performed. If it fails I want the form to remain as it but but the form closes and returns an <code>DialogResult.OK</code> to the main form. So how do I prevent that from happening?</p>

<p>For e.g.</p>

<pre><code>Button_click
{
    If validation fails pretend we never came here
    else some code.. return DialogResult.OK
}
</code></pre>
