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.
Handle the forms closing event and call errorprovider.Clear()
Ciaran O'Donnell
> This is regarding VS 2003 Windows forms.
>
[quoted text clipped - 12 lines]
>
> An answer other than "don't show the red cross" would be much appreciated.
cashdeskmac - 24 Nov 2006 15:47 GMT
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.
> Handle the forms closing event and call errorprovider.Clear()
>
[quoted text clipped - 16 lines]
> >
> > An answer other than "don't show the red cross" would be much appreciated.