I am using an error provider on my windows form. On submit of the form, I need to check if there is some error present on the form. Can I get if there is a error present in the error provider.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Write a
Validate()method that returns false if it fails validation and execute it fromSaveButtonhandler. You should perform re-validation of all controls of the form in this method.Continue
Saveonly whenValidate()returns true.You could use ErrorProvider.GetError to get an error of a particular control on your form, but to get all errors on the entire form you would need to iterate over all controls that use that particular ErrorProvider instance on your form anyway.