Close window launches validation for modeless form

I have two classes of classes inheriting from a common base. One form is called modal, and the other is non-modal. Validation is required when the focus changes, but not when the form is canceled. When the Close Box check box is selected in a modular form, it closes properly, without any checks on it. When the Close check box is selected in a non-modal form, verification events are activated. The Cancel button using CausesValidation set false works fine in both cases.

I tried setting CausesValidation in a non-modal form to false, but the problem remains. It should be noted that forms are mdi children.

Any ideas?

thank.

+3
source share
1 answer

Set the AutoValidate property of the modeless form to Disable. This will prevent implicit form validation for all child controls.

However, at a later time, if you need to check all child controls, you can use the Form.ValidateChildren () method. This will force check all child controls.

+3
source

Source: https://habr.com/ru/post/1746810/


All Articles