stop closing event from validating

B

Bob Cummings

Greetings

I am sure this is a simple question. But I have "googled" it to death
and have only found one answer that involved a bunch of window's API
calls that I did not understand.

I am a student taking VB.NET and we are studying the Validation event
and how to use it on text boxs. I have set the forms.causevalidation
property to false. But if the user has bad data in the text box and
just wants to quit the program by clicking on the control box 'x' on the
upper right corner of the form they are stuck until they correct the
data in the text box. It appears some how the closing event is firing
some sort of validating event. I found a post from Herfried to set the
offending text box's causes validation to false in the form closing
event and that will work the second time the user tries to close the
form but not the first.

I do have the exit button working correctly, but that seems cheesy to me
to not be able to close the form.

Any ideas?

thanks

Bob
 
C

Cor

Hi Bob,
I know it is (if I understand you well) the e.cancel in the validating
event, that has to be set to true or false to in this kind of situations.

Only I once have took time to searched what it was, put it in this newsgroup
and suddenly it was disapeared.

I now have the feeling not to do it again, I only remember me that it was
what you not would expect so probably false.

So do me a favour, find it out what it is "true" or "false" and send that
back to this newsgroup in this thread.

If you don't succeed, message it, than I will look again
I hopes we help each other?

Cor
 
B

Bob Cummings

Hi Cor
Hi Bob,
I know it is (if I understand you well) the e.cancel in the validating
event, that has to be set to true or false to in this kind of situations.

Yes that is exactly what I was talking about. How to stop the e.cancel
from being set to true in the text box validating event when I am
closing the form by way of the control box in upper right hand corner.
Only I once have took time to searched what it was, put it in this newsgroup
and suddenly it was disapeared.

Sounds like the story of my life said:
I now have the feeling not to do it again, I only remember me that it was
what you not would expect so probably false.

So do me a favour, find it out what it is "true" or "false" and send that
back to this newsgroup in this thread.

If you don't succeed, message it, than I will look again
I hopes we help each other?

Cor


thanks Bob
 

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