How to check form controls before closing a form?

I wrote handlers for checking the events of form controls. How can I initiate verification of all elements in the form?

+3
source share
3 answers

You can use the ValidateChildren () method .

+3
source

I think you can achieve this by calling ValidateChildrenin the form.

+2
source

You should be able to handle the Closing event on the form, and there they call the Check call . Based on the return value, you can either close the form or close the form closing.

+1
source

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


All Articles