How to cancel a form's Error Provider?

N

~~~ .NET Ed ~~~

Something I never liked about the error providers in Windows Forms is that
sometimes they get on the way. But pershaps there is something I do not
know.

I have several textboxes and comboboxes in my windows form. These have an
associated Error provider which is used in conjunction with the control's
Validating event. So far so good.

However, if the user decides to press the Cancel button and abandon the form
then the error provider will not let the user abandon the form until all
items validate correctly!!! is there a way I can have my Cancel button click
event be fired in spite of the ErrorProvider ?

Thanks in advance
Emilio
 
N

~~~ .NET Ed ~~~

Aha! after sifting through a lot of useless results I found an article in
examcram2.com which was not only concise and informative but also contained
the solution to the problem. Here it is:

Set the CausesValidation property of the CANCEL button to FALSE. Then the
user can abort data input and validation is not fired. The SAVE button
however will keep the property set to TRUE for obvious reasons.
 

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