avoid this.close to raise validating events ?

  • Thread starter Thread starter nico
  • Start date Start date
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 !!
 
override the Close event, and "forget" to call base.Close
method. You may need to use the new keyword.
 
Back
Top