In that case you should also somehow tell the user that there’s a problem with the field. For example, if the user presses Tab, clicks on another control, presses Enter to trigger the Accept button, or presses Esc to trigger the Cancel button.
though: The Error Provider component does not provide built-in support for accessibility clients.Also, you want to avoid if/else's as much as possible in favour of returning early.I have some code that checks and makes sure that when the users enters in the field an integer from 1 - 10 has to be input.In a Win Form I'm doing initial validation in the Form. To make the code short only three fields are shown in the code.So before saving data, I want to validate whether all the required fields are filled (Text Boxes) by the user. I would rather use a generic function that would be passed each control on the form and based on the type of the control, separate validation logic would be written.