Errorprovider validating

Rated 3.84/5 based on 882 customer reviews

I want the form to process something ONLY whenall the textboxes are valid.

I found a solution, but it seems like a workaround.

Set Error(Text Box2, "Error2") Error Counter = 1 Else Error Provider1. Each text box gets validated with the Error Provider. Set Error(Text Box1, "Error") Error Counter = 1 Else Error Provider1. Set Error(Text Box2, "") End If If Error Counter = 0 Then 'process code that only happens when there are NO errors End If End Sub Is this a good way to handle it, or am I missing a better technique? If you are interested have a look at: HTH Best regards Ulrich Kulle *************************************** You dont have to use a counter.

errorprovider validating-43

errorprovider validating-32

You can use the Windows Forms Error Provider component to view column errors within a dataset or other data source.I'm not sure ifit's the best way: Dim Error Counter As Integer Private Sub btn OK_Click(By Val sender As System. For this, I add two Error Provider components to the Form by dragging and dropping them from the Tool Box to the Form.I change their names to Name Error Provider and Age Error Provider.Now, on the Button click event handler, I validate name and age and if the data is not valid, I display error messages in the Error Providers by calling the Error Provider.

Leave a Reply