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 / Languages / C# / November 2006

Tip: Looking for answers? Try searching our database.

Easy one about supressing validation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cashdeskmac - 24 Nov 2006 11:24 GMT
This is regarding VS 2003 Windows forms.

I have TextBoxes which use the Validating event when the user shifts focus.  
When the user closes down the form using the red cross in the top left
corner, validation still takes place if a TextBox has focus.

I have used this in the Validating handlers:

If(this.ActiveControl==btnExit)

     return;

to supress validation if the Exit button is cleared, but how do I apply this
to the red cross on the form?

An answer other than "don't show the red cross" would be much appreciated.
Ciaran O''Donnell - 24 Nov 2006 15:16 GMT
Handle the forms closing event and call errorprovider.Clear()

Ciaran O'Donnell

> This is regarding VS 2003 Windows forms.
>
[quoted text clipped - 12 lines]
>
> An answer other than "don't show the red cross" would be much appreciated.
cashdeskmac - 24 Nov 2006 15:47 GMT
Tried that, but the Validating event is called before the closing event.  I
need the Validating event to recognise that the red cross was clicked and
tell it to return out of the Validating handler.

> Handle the forms closing event and call errorprovider.Clear()
>
[quoted text clipped - 16 lines]
> >
> > An answer other than "don't show the red cross" would be much appreciated.

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.