UberDeveloper
asked on
In VB.NET how do you clear the Error Provider Icon from a form once it has been displayed?
I have this code:
Dim err1 as New ErrorProvider
If TextBox1.Text = ""
e.Cancel = True
err1.SetError(TextBox1, "Please Enter A Name")
Else
e.Cancel = False
err1.SetError(TextBox1, "")
End If
But what I want to know is how you clear the icon, if the user leaves the Textbox blank and then hits tab the error provider ICON is placed on the form next to the
Textbox control, but then if they enter a valid value and hit tab the icon stays next to the box. I don't want my users to think that there is still a problem.
I have the above code in the "Validating" event for the textbox.
Dim err1 as New ErrorProvider
If TextBox1.Text = ""
e.Cancel = True
err1.SetError(TextBox1, "Please Enter A Name")
Else
e.Cancel = False
err1.SetError(TextBox1, "")
End If
But what I want to know is how you clear the icon, if the user leaves the Textbox blank and then hits tab the error provider ICON is placed on the form next to the
Textbox control, but then if they enter a valid value and hit tab the icon stays next to the box. I don't want my users to think that there is still a problem.
I have the above code in the "Validating" event for the textbox.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER