开发者

How to validate controls of the form before closing the form?

开发者 https://www.devze.com 2023-02-14 08:41 出处:网络
I have written handlers for Validating events of the controls of the form. 开发者_JS百科How can I trigger validation of the all elements on the form?You can use the ValidateChildren() method.I think y

I have written handlers for Validating events of the controls of the form. 开发者_JS百科How can I trigger validation of the all elements on the form?


You can use the ValidateChildren() method.


I think you can achieve that by invoking ValidateChildren on the form.


You should be able to handle the Closing event on the form and in there do a call to the Validate method. Based on the return value you would either let the form close or cancel the closing of the form.

0

精彩评论

暂无评论...
验证码 换一张
取 消