473,394 Members | 1,737 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,394 software developers and data experts.

Easy one about supressing validation

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.
Nov 24 '06 #1
2 1242
Handle the forms closing event and call errorprovider.Clear()

Ciaran O'Donnell

"cashdeskmac" wrote:
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.
Nov 24 '06 #2
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.

"Ciaran O''Donnell" wrote:
Handle the forms closing event and call errorprovider.Clear()

Ciaran O'Donnell

"cashdeskmac" wrote:
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.
Nov 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
1
by: Jp Calderone | last post by:
When using PyChecker on a project which uses bsddb, dozens of messages like the following are reported: warning: couldn't find real module for class bsddb._db.DBAccessError (module name:...
2
by: wumingshi | last post by:
Hi, When validating an XML instance, sometimes the schema is not enough to expression the validation rules. Additional validation rules may be expressed in an application-specific way. For...
11
by: Michael B Allen | last post by:
Is there a standard method for supressing warnings regarding unused parameters? I have a function that might be called hundreds of thousands of times that looks like this: const void *...
6
by: Jack Addington | last post by:
I am capturing a set of validation messages from my validation method. I was putting each message back into a StringCollection. I then wanted to output a big warning message in a Dialog box. Is...
3
by: Rob Meade | last post by:
Hi all, I have a login page which has username and password fields, a login button, and 2 validation controls (one for each field) - currently I have controls to display to the summary if the...
2
by: Chad | last post by:
I have a textbox control, txtMeasurement, that I want to allow only numeric decimal input. I thought to use a client side validation control to ensure that the data entered is of type "Double". ...
2
by: daniel.boorn | last post by:
Form validation using JavaScript has never been as easy and simple! We have developed a free generic form validation script that can validate any form with very little JavaScript required in form!...
5
by: Paul | last post by:
I normally use HTML_Quickform but new client's server doesn't have it and can't get it (ipowerweb.com). So I am reverting back to my beginnings and have forgotten how to validate forms easily. ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.