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

Ignoring Validation Events

Another quesiton,

I have a form, with a control on it that has a handler for control.validated
event.

Now, if that control has focus, and I click the close button the validation
event fires..

So I think to myself, how to tell this, so I add a private property on the
form called IsClosing, which is set by the Form.Closing event...

However, validated seems to fire before the closing event, negating the
whole purpose... anyone have a workaround/solution to this?

Thanks,
CJ
Nov 20 '05 #1
3 1077
Cor
Hi CJ,

I did not know anymore if this has to be true or false,
I tried it on that dialogform from you, it did gave also for me strange
behaviour because there it was not necessary to do this.

Private Sub Form2_Closing(ByVal sender As Object, _
ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = False
End Sub

Cor
Nov 20 '05 #2
* "Cor" <no*@non.com> scripsit:
I did not know anymore if this has to be true or false,
I tried it on that dialogform from you, it did gave also for me strange
behaviour because there it was not necessary to do this.

Private Sub Form2_Closing(ByVal sender As Object, _
ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = False
End Sub


.... nevertheless, validation will be done before the event fires,
doesn't it?

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Nov 20 '05 #3
yep....

annoying isn't it. =)
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c2*************@ID-208219.news.uni-berlin.de...
* "Cor" <no*@non.com> scripsit:
I did not know anymore if this has to be true or false,
I tried it on that dialogform from you, it did gave also for me strange
behaviour because there it was not necessary to do this.

Private Sub Form2_Closing(ByVal sender As Object, _
ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = False
End Sub


... nevertheless, validation will be done before the event fires,
doesn't it?

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>

Nov 20 '05 #4

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

Similar topics

2
by: Dean A. Hoover | last post by:
I am attempting to parse an extremely simple xml file that has an embedded DTD using java sax2. Here is the xml file: <?xml version="1.0" ?> <!DOCTYPE foo > <foo> <bar/> </foo>
7
by: Marina | last post by:
Imagine a form with some fields and an OK buttons that saves the information. Each field has validation logic in the Validating event. If the input is not valid, the control's value is replaced...
1
by: Andy | last post by:
I am having some trouble validating XML using the XmlValidatingReader. I have created some xml and used the visual studio to generate the schema. So I am confident that the xml and schema match. ...
5
by: Dennis C. Drumm | last post by:
Is there a way to prevent the user from leaving a tab on a TabControl until all the controls on that tab have finished validating? The problem I am experiencing is when a control fails its...
1
by: Simon | last post by:
Hi, Has anyone experienced the problem where validation controls stop a previously working page from submitting. Sometimes, when I move between my work machine and my home machine validation...
4
by: AIM48 | last post by:
Hi. We have a framework that we work with for our project. So far we have had very good success – basically the frame work wraps many day to day tasks so that they are all included in the...
5
by: Richard Brown | last post by:
Ok, I've been looking through the .NET SDK docs and stuff. I'm wondering if you can provide a control extender that does generic validation or functionality just by dropping it on the form. For...
2
by: Tim Frawley | last post by:
Source code attached indicates my problem with validation and a button bar save button. Fill the Textbox with some text then tab off the control. The message box will display the text in the...
3
by: teo | last post by:
Mozilla error on postback and validation ----------- A Button causes a Listbox to desappear. If no item has been selected on the Listbox, all is OK. If one or more items are selected,
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.