The Error Provider component displays an error icon () next to the relevant control, such as a text box; when the user positions the mouse pointer over the error icon, a Tool Tip appears, showing the error message string.The Error Provider component's key properties are Data Source, Container Control, and Icon.Handle) ' Locks the form if "Me" is the form Lock Window Update(0&) ' Unlocks whatever was locked previously It doesn't stop the user from entering text but the added (or changed or removed) text won't appear until after the unlock. Have you set the Causes Validation property of the Save button to true?
Select() End if Next c End Sub Each control has code in their Control_Validating event that fires off an errorprovider.
In this case, I think the simplest solution is to validate these textboxes in the Save button's Click event handler, instead of validating the textboxes in their Validating event handler. None" above prevents the dialog box from closing & returning Dialog Result. Here's my code | | Private Sub Save() | For each c as control in Me.
Of course, you could include the code of validating these textboxes in a function and call this function in the Save button's Click event handler. If you have anything unclear, please feel free to let me know. None Exit For End If End If Next End Sub NOTE: This loop probably should be recursive to get controls within container controls, within other container controls...
The flexibility of storing validation settings in a configuration file makes validation easy to change, allowing developers and administrators to modifiy or customize validation properties without recompiling and redeployingand without needing the source code.
You'll find that using the validation engine discussed here, you can instrument a wide range of validation criteria with very few lines of code.