By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,166 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,166 IT Pros & Developers. It's quick & easy.

Prevent the fireing of a textbox leave event

P: n/a
I have code (using the leave event) in a textbox which prevents the user
from leaving the box if it is blank. I would like the user to be able to
click on the [close] button of the form and close that form without firing
the leave event in that text box. An answer would be helpful.

Thanks,

Bill
Jun 17 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hello William,

Preventing the user from leaving a text box is really just bad form. Users
don't like it, and it creates headaches for the programmer, as you have experienced.
Typically user input validation is done when the Submit/OK/Apply button
is pressed.. if there is an error you can indicate the error at that time.
It's an extremely rare case where input validation HAS to be done as the
user is typing.

-Boo
I have code (using the leave event) in a textbox which prevents the
user from leaving the box if it is blank. I would like the user to be
able to click on the [close] button of the form and close that form
without firing the leave event in that text box. An answer would be
helpful.

Thanks,

Bill

Jun 18 '06 #2

P: n/a
that's an Answer?

"GhostInAK" <gh*******@gmail.com> wrote in message
news:c7**************************@news.microsoft.c om...
Hello William,

Preventing the user from leaving a text box is really just bad form.
Users don't like it, and it creates headaches for the programmer, as you
have experienced. Typically user input validation is done when the
Submit/OK/Apply button is pressed.. if there is an error you can indicate
the error at that time. It's an extremely rare case where input validation
HAS to be done as the user is typing.

-Boo
I have code (using the leave event) in a textbox which prevents the
user from leaving the box if it is blank. I would like the user to be
able to click on the [close] button of the form and close that form
without firing the leave event in that text box. An answer would be
helpful.

Thanks,

Bill


Jun 18 '06 #3

P: n/a
Ghost

In fact did you write in my idea the answer, don't use an own routine, use
the validating events and the errorprovider.

http://msdn2.microsoft.com/en-us/sys...rprovider.aspx

I hope this helps

Cor

"GhostInAK" <gh*******@gmail.com> schreef in bericht
news:c7**************************@news.microsoft.c om...
Hello William,

Preventing the user from leaving a text box is really just bad form.
Users don't like it, and it creates headaches for the programmer, as you
have experienced. Typically user input validation is done when the
Submit/OK/Apply button is pressed.. if there is an error you can indicate
the error at that time. It's an extremely rare case where input validation
HAS to be done as the user is typing.

-Boo
I have code (using the leave event) in a textbox which prevents the
user from leaving the box if it is blank. I would like the user to be
able to click on the [close] button of the form and close that form
without firing the leave event in that text box. An answer would be
helpful.

Thanks,

Bill


Jun 18 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.