Close Form without causing validation of controls

  • Thread starter Thread starter cody
  • Start date Start date
C

cody

Is it possible to close a Form without causing validation of controls?
If the user determines to close the form without saving the data, there
should no validation event occur.
 
* "cody said:
Is it possible to close a Form without causing validation of controls?
If the user determines to close the form without saving the data, there
should no validation event occur.

In the button's 'Click' event handler, set the textbox's
'CausesValidation' property to 'False'.
 
But, if you click the X (close) button of the form, Validating event still
occurs....
how to work around this ??
 
Hide the control box and dispose it in the click-event.

Sorry, couldn't resist.

;-)

Klaus

PS: That could be a solution, though, couldn't it?

Alok said:
But, if you click the X (close) button of the form, Validating event still
occurs....
how to work around this ??
 
Klaus,
In my opinion we already have another thread going for fighting over this
issue :)

-Alok

Klaus Löffelmann said:
Hide the control box and dispose it in the click-event.

Sorry, couldn't resist.

;-)

Klaus

PS: That could be a solution, though, couldn't it?
 
Back
Top