ErrorProvider and Closing Forms

O

Otis Mukinfus

I have a form that uses the ErrorProvider control on several TextBox
objects.

All works as expected except when the close button in the upper right
hand corner of the form is clicked. When this button is clicked it
fires the IsValidating event of the control with focus.

I believe that if the user is closing the form there should be no
validation events fired.

How does one prevent this from happening?

Additional information... the IsValidating events fire before the IsC
losing event of the form, so I can't trap anything there.

Otis Mukinfus
http://www.otismukinfus.com
 
S

Sijin Joseph

What i did was to disable the upper-right close button and use a cancel
button on the form with the CausesValidation property set to false.
 
O

Otis Mukinfus

What i did was to disable the upper-right close button and use a cancel
button on the form with the CausesValidation property set to false.

Thank you Sijin.

The form I'm working with is the main form of the application and I
hesitate to do that, but it certainly would cure the problem. I may
do that if I can't find another way.

If I do find another way I will post it.

Thanks again,


Otis Mukinfus
http://www.otismukinfus.com
 

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