Close box triggers validation for non-modal form

Posted by Governor on Stack Overflow See other posts from Stack Overflow or by Governor
Published on 2010-05-24T02:28:43Z Indexed on 2010/05/24 2:30 UTC
Read the original article Hit count: 315

Filed under:
|
|
|

I have two form classes inheriting from a common base. One of the forms is called modally and the other non-modally. Validation is required on focus changes but not when the form is cancelled. When the Close Box is selected on the modal form it closes properly without any validation being triggered on it's controls. When the Close Box is selected on the non-modal form, validation events are triggered. A Cancel button with CausesValidation set false works fine in both cases.

I have tried setting CausesValidation on the non-modal form to false but the problem remains. I should mention that the forms are mdi children.

Any ideas?

Thx.

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms