Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
679 views
in Technique[技术] by (71.8m points)

winforms - disable validation of errorprovider when click cancel button

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...