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

Avoiding the "valid" callback when a form exits

Tom
I'm making a database input form that has many text boxes
bound to DB fields. I've written a validatedTextBox
class that inherits from textBox but validates the input
data. It does this with code that overrides
the "onValidating" event of textbox.

It all works great except if I exit the form (by clicking
the x in the upper right corner) with invalid data in a
textbox, my onValidating routine gets called and I am
prevented from exiting the form. I would like to know
the form is exiting and ignore the validation in that
case. (There is an accept button the user is supposed to
use if they want to keep the data.) I've looked at
multiple public methods and public properties of the form
but haven't found any which get set or executed before
the onValidation event of my textbox that is on the form.

Any suggestions?
Nov 20 '05 #1
2 1169
Hi,

Make sure the forms causesvalidation property is false.

Ken
-----------------

"Tom" <an*******@discussions.microsoft.com> wrote in message
news:1e*****************************@phx.gbl:
I'm making a database input form that has many text boxes
bound to DB fields. I've written a validatedTextBox
class that inherits from textBox but validates the input
data. It does this with code that overrides
the "onValidating" event of textbox.

It all works great except if I exit the form (by clicking
the x in the upper right corner) with invalid data in a
textbox, my onValidating routine gets called and I am
prevented from exiting the form. I would like to know
the form is exiting and ignore the validation in that
case. (There is an accept button the user is supposed to
use if they want to keep the data.) I've looked at
multiple public methods and public properties of the form
but haven't found any which get set or executed before
the onValidation event of my textbox that is on the form.

Any suggestions?


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.3 - Release Date: 6/18/2004
Nov 20 '05 #2
It was true. I set it to false and it made no
difference. The documentation says this determines if it
does validation on components when the form gets focus.
I am try to exit it the (it has had focus all along.)

Any other ideas?
-----Original Message-----
Hi,

Make sure the forms causesvalidation property is false.
Ken
-----------------

"Tom" <an*******@discussions.microsoft.com> wrote in messagenews:1e*****************************@phx.gbl:
I'm making a database input form that has many text boxes bound to DB fields. I've written a validatedTextBox
class that inherits from textBox but validates the input data. It does this with code that overrides
the "onValidating" event of textbox.

It all works great except if I exit the form (by clicking the x in the upper right corner) with invalid data in a
textbox, my onValidating routine gets called and I am
prevented from exiting the form. I would like to know
the form is exiting and ignore the validation in that
case. (There is an accept button the user is supposed to use if they want to keep the data.) I've looked at
multiple public methods and public properties of the form but haven't found any which get set or executed before
the onValidation event of my textbox that is on the form.
Any suggestions?

--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.3 - Release

Date: 6/18/2004

.

Nov 20 '05 #3

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

Similar topics

0
by: Tao | last post by:
I just upgraded .NET framework to 1.1 and VS.Net to 2003 version and tried to test it out. I created an ASP.NET project using the wizard and tried to run it by hitting "F5". I got an exception:...
1
by: Ron Holmes | last post by:
I posted this question on the Crystal Reports Support site and I am still waiting for an answer. Using Crystal Reports 9.0 Developer Full edition: My Crystal report .RPT file has a Picture box...
5
by: Yongming Wang | last post by:
FuncA is called to delete itself with B's help. In vc 7.0, case 1 seems invalid, but case 2 is valid. Could anyone explain for me? class A { public: void FuncA() { B b(this);
20
by: Petter Reinholdtsen | last post by:
Is the code fragment 'char a = ("a");' valid ANSI C? The problematic part is '("a")'. I am sure 'char a = "a";' is valid ANSI C, but I am more unsure if it is allowed to place () around the...
11
by: Jim H | last post by:
I am trying to go through my Outlook (2003) address book. The code goes through the Items list and prints all the last names but after it hits 114 (out or 126 contacts) I get a "sepcified cast is...
2
by: Fabian | last post by:
Hi, I work with asp.net 2.0 and I have a intermittent error, only happens a few times a day. In the page I evaluate a Query String and then I get data form a database. The code snipped: ...
4
by: Mike Cooper | last post by:
There is something about inherited classes I evidently don't know... I wrote the following class: Class Class1 inherits System.Windows.Forms.DataGridTextBoxColumn End Class There is...
1
by: Mesan | last post by:
I'm getting a "Cross-thread operation not valid" Exception and I can't figure out why. I've got a BackgroundWorker that creates a UserControl with a whole lot of other user controls inside of...
7
by: bookon | last post by:
I was running into the System.Drawing.Image.FromStream "parameter is not valid" on some of the images I was retrieving from a blob column in Sql Server. I thought there were corrupt images as...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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.