Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

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.

Jarod
  • *Experts*
Posted

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:

ErrorProvider1.SetError(mytxtBox, String.Empty)

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...