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 Controls / June 2008

Tip: Looking for answers? Try searching our database.

Notifying user of Textbox input error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
brad - 25 Apr 2008 21:17 GMT
I have 20+ Textboxes on a form bound to data fields; some hold dates.  If an
invalid date is entered the control prevents the user from moving to another
control (this is automatically handled by the default implementation of
Textbox), but no error message is shown and nothing happens to alert the
user.  How can I alert the user to the error without writing code for each
Textbox.  DataGridView handles this nicely with a messagebox, but the only
solution I could find for Textbox was to write validation code for each
Textbox.  It doesn't seem like I should need to do this since the textbox
knows the data is invalid.  What am I missing?
Signature

brad

brad - 28 Apr 2008 19:17 GMT
I am dynamically adding these textboxes to the form based on the data to be
edited.   What I am looking for is behavior similar to the Visual Studio .NET
Properties window and how it provides an error message if you enter a
property value that is invalid.
Signature

brad

brad - 23 Jun 2008 18:49 GMT
Here's the answer:
http://msdn.microsoft.com/en-us/library/aa480734.aspx?wt.slv=ColumnA

I'm a bit disappointed with the amount of effort I had to go through to find
and implement this, not because I mind doing my own research, but because
1) In my opinion the solution was not easy to find
2) I needed to convert the solution from VB to C#
3) it seems like a journey that many others would have gone through, would
have remembered and therefore could have easily helped with (MVPs?) .

brad

> I am dynamically adding these textboxes to the form based on the data to be
> edited.   What I am looking for is behavior similar to the Visual Studio .NET
> Properties window and how it provides an error message if you enter a
> property value that is invalid.
brad - 23 Jun 2008 18:56 GMT
I should have mentioned the solution is under the section on "Improved
Handling of Errors and Exceptions"

brad

> Here's the answer:
> http://msdn.microsoft.com/en-us/library/aa480734.aspx?wt.slv=ColumnA
[quoted text clipped - 12 lines]
> > Properties window and how it provides an error message if you enter a
> > property value that is invalid.

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.