November 30, 2006

Using an ErrorProvider

1. Add it to the form
// 2. Initialise it:
errorProvider.BlinkStyle = ErrorBlinkStyle.AlwaysBlink;
errorProvider.SetIconAlignment(this, ErrorIconAlignment.MiddleRight);
errorProvider.SetIconPadding(this, 2);

// 3. To flag an error
errorProvider.SetError(tbName, "The specified user name is unknown");

// 4. To stop it flashing
errorProvider.Clear(); 

No comments: