You could assign DialogResult.None to the Button.DialogResult, either in
designer or in your OnClick handler to prevent the form from closing.

-----Original Message-----
From: The DOTNET list will be retired 7/1/02
[mailto:[EMAIL PROTECTED]] On Behalf Of Chris Sells
Sent: Tuesday, June 11, 2002 8:48 AM
To: [EMAIL PROTECTED]
Subject: [DOTNET] Why is CancelButton special?


If I set the AcceptButton to a button whose DialogResult is set to None,
pressing that button does not automatically close the form.

However, if I set the CancelButton to a button whose DialogResult is set
to None, pressing the button *does* automatically close the form and I
don't see any way to halt this process, even if I've got an event
handler for that button. Why is that?

Chris Sells
http://www.sellsbrothers.com/

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to