Avoiding the "valid" callback when a form exits

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I'm making a database input form that has many text boxes
bound to DB fields. I've written a validatedTextBox
class that inherits from textBox but validates the input
data. It does this with code that overrides
the "onValidating" event of textbox.

It all works great except if I exit the form (by clicking
the x in the upper right corner) with invalid data in a
textbox, my onValidating routine gets called and I am
prevented from exiting the form. I would like to know
the form is exiting and ignore the validation in that
case. (There is an accept button the user is supposed to
use if they want to keep the data.) I've looked at
multiple public methods and public properties of the form
but haven't found any which get set or executed before
the onValidation event of my textbox that is on the form.

Any suggestions?
 
Hi,

Make sure the forms causesvalidation property is false.

Ken
-----------------
 
It was true. I set it to false and it made no
difference. The documentation says this determines if it
does validation on components when the form gets focus.
I am try to exit it the (it has had focus all along.)

Any other ideas?
 
Back
Top