Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using ErrorProviders...Can not get the icon to clear

Status
Not open for further replies.

dollarbillg

Programmer
Joined
Dec 3, 2002
Messages
12
Location
US
Hello,
I am using an ErrorProvider on several textboxes. The Provider works to the extent that it lets the user know of invalid data being entered however after the correct data has been entered the Icon(!) does not clear.

Here is my code:

Private Sub txtHole1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtHole1.Validating
If (txtHole1.Text) = 0 Then
ErrorProvider1.SetError(txtHole1, "The players score cannot be 0.")
e.Cancel = True
Else
' Clear the error.
'ErrorProvider1.SetError(txtHole1, " ")
End If
If (txtHole1.Text) > 6 Then
ErrorProvider1.SetError(txtHole1, "The highest score a player can have is 2 over par.")
e.Cancel = True
Else
' Clear the error.

End If

End Sub

Any and all help would be appreciated.

Dollarbillg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top