Hi all,
I have a button in a form that has associated a DialogResult = OK.
When I press the button I perform some check and in case I don't wont to exit to the form .
I don't want to process the button click....
Thanks
Printable View
Hi all,
I have a button in a form that has associated a DialogResult = OK.
When I press the button I perform some check and in case I don't wont to exit to the form .
I don't want to process the button click....
Thanks
I've always found it easiest to control this kind of thing manually. I'd do something like this:
For this to work, you also need to set the button's DialogResult property to None in the designer.Code:private void button1_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.None;
if(something)
this.DialogResult = DialogResult.OK;
}