Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2005

Tip: Looking for answers? Try searching our database.

Text Box Validation - prevent a blank entry

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ecurb - 17 Oct 2005 22:49 GMT
Hi,
I have a form with several text boxes on it.
Each test box requires some validation ... for being numeric etc.
and I am successfully using the Validating and Validated events of each
text box and an ErrorProvider to achieve this...

However, I want to validate one of the text boxes such that the user
*must* enter a value... ie. the text box must be non-blank.
I tried putting code in the Validating event to disallow a blank
value.. this did not work.
The problem is that the Validating event is only invoked if the text
box gets focus. If the user never clicks on the text box, then me error
is never displayed.

How do I force this validation .. even if text box never gains focus ?

Many thanks.
Nelson Guerra - 18 Oct 2005 09:27 GMT
Hello

I don't know what are you trying to do but why don't you validate if the
textbox is blank when the user make the finnal action.
Something like before send the data to the database

> Hi,
> I have a form with several text boxes on it.
[quoted text clipped - 13 lines]
>
> Many thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.