Click here to Skip to main content
15,930,958 members
Home / Discussions / C#
   

C#

 
GeneralRe: OR? Pin
Heath Stewart8-Dec-03 11:41
protectorHeath Stewart8-Dec-03 11:41 
GeneralRe: OR? Pin
eggie58-Dec-03 11:45
eggie58-Dec-03 11:45 
GeneralRe: OR? Pin
Heath Stewart8-Dec-03 11:46
protectorHeath Stewart8-Dec-03 11:46 
GeneralRe: OR? Pin
eggie58-Dec-03 11:51
eggie58-Dec-03 11:51 
GeneralClose Form Validation Pin
mitdej8-Dec-03 1:07
mitdej8-Dec-03 1:07 
GeneralRe: Close Form Validation Pin
Colin Angus Mackay8-Dec-03 1:39
Colin Angus Mackay8-Dec-03 1:39 
GeneralRe: Close Form Validation Pin
mitdej8-Dec-03 2:17
mitdej8-Dec-03 2:17 
GeneralRe: Close Form Validation Pin
Heath Stewart8-Dec-03 3:01
protectorHeath Stewart8-Dec-03 3:01 
That code only works if an event handler was added for that method in the first place.

You could try handling Form.Closing and set a boolean field or something so that your validation event handlers don't validate if it's set. Unfortunately, I can't find any information about order of events in relation to Validating, Valiated, Closing, and Closed, but it's worth a shot. Another way - if the order is correct - would be to just remove the validating event handlers in the Closing event, so long as CancelEventArgs.Cancel (passed to the event handler) is not set to true. It might be even better that you override OnClosing and call the base.OnClosing method to make sure that all event listeners have had a chance to set CancelEventArgs.Cancel so you know for sure if you really should unhook those validation event handlers.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: Close Form Validation Pin
mitdej8-Dec-03 3:34
mitdej8-Dec-03 3:34 
GeneralRe: Close Form Validation Pin
Heath Stewart8-Dec-03 3:45
protectorHeath Stewart8-Dec-03 3:45 
GeneralRe: Close Form Validation Pin
mitdej8-Dec-03 4:01
mitdej8-Dec-03 4:01 
GeneralRe: Close Form Validation Pin
Heath Stewart8-Dec-03 4:56
protectorHeath Stewart8-Dec-03 4:56 
GeneralRe: Close Form Validation Pin
mitdej8-Dec-03 20:38
mitdej8-Dec-03 20:38 
GeneralDebugging C++ DLL with C# Pin
Simon Wren8-Dec-03 0:26
professionalSimon Wren8-Dec-03 0:26 
GeneralRe: Debugging C++ DLL with C# Pin
Heath Stewart8-Dec-03 2:54
protectorHeath Stewart8-Dec-03 2:54 
GeneralRe: Debugging C++ DLL with C# Pin
Simon Wren8-Dec-03 3:08
professionalSimon Wren8-Dec-03 3:08 
QuestionWhat is the proper way to remove a control from a panel? Pin
vektuz7-Dec-03 23:19
vektuz7-Dec-03 23:19 
AnswerRe: What is the proper way to remove a control from a panel? Pin
vektuz8-Dec-03 0:03
vektuz8-Dec-03 0:03 
AnswerRe: What is the proper way to remove a control from a panel? Pin
Heath Stewart8-Dec-03 2:50
protectorHeath Stewart8-Dec-03 2:50 
GeneralRe: What is the proper way to remove a control from a panel? Pin
vektuz8-Dec-03 8:35
vektuz8-Dec-03 8:35 
GeneralRe: What is the proper way to remove a control from a panel? Pin
vektuz8-Dec-03 8:48
vektuz8-Dec-03 8:48 
GeneralRe: What is the proper way to remove a control from a panel? Pin
Heath Stewart8-Dec-03 9:22
protectorHeath Stewart8-Dec-03 9:22 
GeneralLoading a class at runtime from an assembly Pin
AJ1237-Dec-03 22:53
AJ1237-Dec-03 22:53 
GeneralRe: Loading a class at runtime from an assembly Pin
Tim Friesen8-Dec-03 1:29
Tim Friesen8-Dec-03 1:29 
GeneralRe: Loading a class at runtime from an assembly Pin
Heath Stewart8-Dec-03 2:46
protectorHeath Stewart8-Dec-03 2:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.