单击取消按钮时禁用错误提供程序的验证 [英] disable validation of errorprovider when click cancel button

查看:24
本文介绍了单击取消按钮时禁用错误提供程序的验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当单击取消按钮以关闭 winform 时,有没有办法优雅地禁用 errorprovider 的验证?验证总是在文本框失去焦点时发生,我不希望它在用户单击取消按钮时进行验证,当用户单击取消时进行验证有点傻.

is there a way to disable the validation of errorprovider elegantly when click cancel button to dismiss a winform? The validation always happens when the textbox lose focus, and i don't wanna it to validate when the user click cancel button, it is just a little bit silly to validate when the user clicking cancel.

推荐答案

谷歌搜索后,找到了答案,只需将取消按钮的 CauseValidation 属性设置为 false.就是这样.

after googling, found the answer, just set CauseValidation property of the cancel button to false. that's it.

这篇关于单击取消按钮时禁用错误提供程序的验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆