ErrorProvider and Closing Forms

  • Thread starter Thread starter Otis Mukinfus
  • Start date Start date
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
 
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.
 
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
 
Back
Top