开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜