Easy one about supressing validation

G

Guest

This is regarding VS 2003 Windows forms.

I have TextBoxes which use the Validating event when the user shifts focus.
When the user closes down the form using the red cross in the top left
corner, validation still takes place if a TextBox has focus.

I have used this in the Validating handlers:

If(this.ActiveControl==btnExit)

return;

to supress validation if the Exit button is cleared, but how do I apply this
to the red cross on the form?

An answer other than "don't show the red cross" would be much appreciated.
 
G

Guest

Tried that, but the Validating event is called before the closing event. I
need the Validating event to recognise that the red cross was clicked and
tell it to return out of the Validating handler.
 

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