'&' is being shown as '_' in a string c#

Ram

I want to set the error message to text box using error provider.

 string strNotAllowedError = "The following characters are not allowed:  \' # & < > or \"";
 errorProvider1.SetError(this.txtbx1, strNotAllowedError);

but the on the screen error message is become like : The following characters are not allowed:'# _ < > or" Here & is replaced by _ Please let me know how to show & in error message as it is.

Damien_The_Unbeliever

You need to double up the & character.

Traditionally, & in strings (that are going to be displayed in the windows UI) is used to precede the keyboard accelerator character. Which when rendered is underlined. If you'd not had a space after the &, you'd have seen whatever character followed underlined, rather than seeing it as the & being replaced by a _.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

why JPanel is not being shown in JFrame?

From Dev

Is it possible to show a badge on an image being shown in ListView

From Dev

Fiddler session disappears after being shown

From Dev

How to stop submit being shown in the address bar?

From Dev

Custom UIViewController's view is not being shown

From Dev

Images from current directory are not being shown

From Dev

UILabel in UITableViewCell is not being shown

From Dev

Notification not being shown on Android

From Dev

value for two parameters not being shown ruby on rails

From Dev

Laravel - Prevent errors from being shown in console

From Dev

Why is element not being shown before alert?

From Dev

Reversing a string in C without the output being null

From Dev

String is not being directed to Output file (C++)

From Dev

Reversing a string in C without the output being null

From Dev

New webpage not being shown

From Dev

Creating a UIBezierPath in UIView Category. not being shown

From Dev

Image is being shown as HTML but no image is shown for DOMPDF()

From Dev

AngularJS animations are not being shown

From Dev

Navbar not being shown

From Dev

C - String being changed by function unintentionally

From Dev

Ä is shown in string as <?>

From Dev

Information Not Being Shown Inline

From Dev

Get string as shown in DataGridView

From Dev

Laravel Vue Component not being shown

From Dev

The output in the console window not being shown

From Dev

How to give mutiple spaces to an integer to shown on form as a string in c#?

From Dev

Modifying a string being passed as argument of a function in C

From Dev

C# Item not being added to List<String>

From Dev

Font Awesome icons not being shown

Related Related

HotTag

Archive