ErrorProvider - not showing new errors

Jarod

Regular
Joined
Feb 5, 2003
Messages
82
Location
Bruxelles
Hello,

It is not really a question, just what I have experienced. I just want to know if it is the "normal working" or if it is a bug...

Say you have a TextBox and an associated ErrorProvider.
Listen to the Validating event to show an error.
and do something as
Visual Basic:
private counter as Integer

private sub Validation(sender as object, e as cancelEventArgs) handles mytxtBox.Validating
counter += 1
if counter mod 2 = 0 then
ErrorProvider1.SetError(mytxtBox, "Error1")
else
ErrorProvider1.SetError(mytxtBox, "Error2")
end sub

If you set the BlinkStyle of the ErrorProvider to NeverBlink, the same error will always be shown. (everything is normal with AlwaysBlink or BlinkIfDifferentErrors)
I use that style because I don't like softs looking like "fireworks", but I would like to have my errors updated.
 
With the code you've shown, I think the Error icon is always going to show. The only that would change is the icon's tooltip text, from Error1 to Error2. To clear the icon, you have to pass an empty string to SetError, as in:
Visual Basic:
ErrorProvider1.SetError(mytxtBox, String.Empty)

-Nerseus
 
Back
Top