avoid this.close to raise validating events ?

N

nico

In a winform, I have a cancel button. When clicking on it,
I want the form to close without raising validation
events. So I'm calling this.close() in the click event;

I have set the CausesValidation property to false for the
button and for the form itself, but the validating events
are raised when calling this.close(). How can I avoid
that ??

Thanks for help !!
 
A

anon

override the Close event, and "forget" to call base.Close
method. You may need to use the new keyword.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top