Textbox validating event
When filling out such forms you have probably experienced the fact that if you hit enter when typing in a textbox the form submits.This is a feature that browsers provide to make it possible to submit a form without having to touch the mouse.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.
The error provider simply takes a control and a message in the Set Error method and does the rest of the work for you!You do not have to disable the Form’s Auto Validate property.