|
-
June 21st, 2010, 04:56 AM
#1
Dialog result
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
-
June 21st, 2010, 05:03 AM
#2
Re: Dialog result
I've always found it easiest to control this kind of thing manually. I'd do something like this:
Code:
private void button1_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.None;
if(something)
this.DialogResult = DialogResult.OK;
}
For this to work, you also need to set the button's DialogResult property to None in the designer.
It's not a bug, it's a feature!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|