AMPERSAND IN LABEL

Giorgio Sfiligoi 391 Reputation points
2022-08-06T10:30:15.63+00:00

How can I show an ampersand in a label?
Normally '&' makes the following character underlined; I instead would like to show it, such as in the string:
"Valid characters include $@%&-_"

Developer technologies | Windows Forms
0 comments No comments
{count} vote

Accepted answer
  1. Reza Aghaei 4,986 Reputation points MVP Volunteer Moderator
    2022-08-06T10:47:26.99+00:00

    You can use && to show one on the control.
    Alternatively you can set UseMnemonic to false, then it treats & as a normal character, so only One needed.

    According to documentations:

    You may want to display ampersands in a label control, rather than use them to create access keys. This may occur if you bind a label control to a field in a recordset where the data includes ampersands. To display ampersands in a label control, set the UseMnemonic property to false. If you wish to display ampersands and also have an access key, set the UseMnemonic property to true and indicate the access key with one ampersand (&) and the ampersand to display with two ampersands.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.