User control validating event

posted by | Leave a comment

Windows Forms provides several ways for you to validate input in your application.If you need to require users to enter data in a well-defined format, such as a telephone number or a part number, you can accomplish this quickly and with minimal code by using the Masked Text Box control.

user control validating event-51user control validating event-89

You should always use the Validating event, it was made to support validation.

By using validation, you can make sure that your control's data satisfies the format required by the data source, and that it does not contain any special characters such as quotation marks and back slashes that might be unsafe.

When you use data binding, the data in your control is synchronized with the data source during execution of the Validating event.

When users enter data into your application, you may want to verify that the data is valid before your application uses it.

You may require that certain text fields not be zero-length, that a field be formatted as a telephone number or other type of well-formed data, or that a string not contain any unsafe characters that could be used to compromise the security of a database.

Leave a Reply

Free online hot sex chat sighs