473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Prevent the fireing of a textbox leave event

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
3 4001
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris Mayers | last post by:
Hi, I have an application that has (for the sake of argument) 2 (MDI) windows open. If I click into a textbox on FormA then the 'Enter' event for that TextBox fires, great! However, if I then...
2
by: JayDee | last post by:
After a user enters data into a field, I need to populate other controls on the form, based on the user entry. I have to use either Leave, Validating or Validated, and I take it I can't use...
1
by: Zyrthofar | last post by:
Hi I have three textboxes indicating the individual RGB values of a color. When the user leaves a textbox (Leave event), I check the validity of that number and saves the three values to a set of...
2
by: AussieRules | last post by:
Hi, I have a form with many textbox on it. Behind this(so to speak), is a class, and each time the user changes the value of the text box I want to update the relevant property of the class. ...
6
by: Frank | last post by:
Hopefully this is the correct group for this message. My previous post to (I assume) a non-.net group was not welcomed. I have a form with 7 text boxes that are all bound to fields of a...
0
by: Billy | last post by:
Anyone know if this a bug in VB.NET 2002 and how to overcame that situation? I have a MDI form from where I call MDI child form like that: Dim frm As New frmChild() frm.MdiParent = Me...
15
by: Billy | last post by:
Anyone know if this a bug in VB.NET 2002 and how to overcame that situation? I have a MDI form from where I call MDI child form like that: Dim frm As New frmChild() frm.MdiParent = Me...
10
by: Dennis | last post by:
I have a simple form with one button and one text box. In the Form, I create an array list to track the events by adding a descriptive string item to the arraylist in each event. I first Click on...
1
by: melanieab | last post by:
Hi again, I have a textbox where the text is longer than the textbox width. When I type something in there or even do any single keystroke (other than tab, up, down, or enter) and then leave, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.