Making the ErrorProvider Go Away

BobbyBaldEage

Member
Joined
Sep 20, 2005
Messages
10
Programming Experience
1-3
I'm loading an errorprovider when the user inputs the wrong data!

GREAT - that bit is working just fine. The little red icon appears beside the txtEmail field.



But when the user re-enters the email, in the correct format, I can’t seem to make the icon disappear!



Any suggestions?
 
Hi Bob,
Thanks for that! I tried the code you suggested but it still didnt work. I'm working on a windows app....could it be a bug??? It seems to hang in memory. I cant even dispose of it, set it to nothing etc

Me.ErrorProvider1.SetError(txtEmail, "")

Me.ErrorProvider1.SetError(txtEmail, String.Empty)

Me.ErrorProvider1 = Nothing

Me.ErrorProvider1.Dispose()

Me.ErrorProvider1.Icon.Dispose()


HELP!!! :)
 
Error Provider

Hello Bobby,

Please try this sub included in the zip example attached, hope it helps :

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

If Char.IsDigit(e.KeyChar) Then

ErrorProvider1.SetError(TextBox1, "")

Else

ErrorProvider1.SetError(TextBox1, "Please enter a decimal number")

e.Handled =​
True

End If

End Sub

 

Attachments

  • Test.zip
    20.9 KB · Views: 26
Back
Top