Hi Pascal,
Sorry, I'm not clear about your problem. the Validating event of Control
is fired when the focus is moving off. It is not fired on form closing. If
you just want to disable the Validating events, you may try this way in
your From_Closing handler.
foreach(Control c in Controls)
c.CausesValidation = false;
Also, because Validation is fired on focus leave, there is no concept of
validation order.
If you want to validate the controls in some order when the form closing ,
you need add these
codes to the Form_Closing event.
Does this answer your problem?
If you still have problems on this issue, please be free to let me know.
Thanks!
Best regards,
Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!
--------------------
| From: "Pascal Cloup" <
[email protected]>
| Subject: Validating events
| Date: Thu, 25 Sep 2003 09:21:30 +0200
| Lines: 12
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| NNTP-Posting-Host: alille-107-1-14-86.w81-48.abo.wanadoo.fr 81.48.217.86
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:53075
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| Hello,
|
| How can i disable the Validating Event of all the controls of a form
after a
| click on a Cancel Button and close the Form?
|
| Or how can fix the order of Validating events of the controls in a Form?
|
| Thanks in advance.
|
| Pascal
|
|
|