Posted By

sysdeamon on 10/07/09



Versions (?)

How to display "&" character in error description string for ErrorProvider

 / Published in: C#

To display "&" character within the string used as error descriptor in ErrorProvidor component in .NET use "&&&" so that it displays as a single "&". More detail at:

  1. // "&&&" are displayed as "&" in error provider tool-tip
  2. string tempStr = "Some Name can not contain the characters: &&&,á,é,í,ó";
  3. this.mainErrorProvider.SetError(this.someNameTxtBox, tempStr);

Report this snippet  

You need to login to post a comment.