Using Ampersand On Label

Cosmos75

Registered User.
Local time
Today, 10:51
Joined
Apr 22, 2002
Messages
1,281
Use AND character (&) in label chr(38)

Is there anyway to show/use the & character in a label?
:confused:
 
Just so you know. The ampersand is typically used for underlining the letter that follows to make an Accelerator Key. By this, if you put &Cancel on a button's caption then it would appear like this: Cancel.

Rather than click the button you now have a keyboard shortcut for your button: by pressing Alt + C
 
Mile-O-Phile said:
...if you put &Cancel on a button's caption then it would appear like this: Cancel.

Rather than click the button you now have a keyboard shortcut for your button: by pressing Alt + C
Mile-O-Phile,
Thanks! That is good to know!
:)

Rich,
Thanks! && is easier to use.
 
I know I'm resurrecting an old thread here, but this post was the top result in my Google search on this issue.

If you're trying to use the "&" symbol within a string (like AT&T for example), you would set the Caption value to "AT&&T" (without the quotes), as the posters above have described.

However, if you want the label to just have the & symbol in it, you need to set the Caption value to "&&&" (without the quotes). For some reason, it looks like you need an extra ampersand in that instance. If anyone else out there is searching for this issue like I was, try this out and see if it works for you.

Looks like it only took 13 years for someone to find the solution for this. :D
 
However, if you want the label to just have the & symbol in it, you need to set the Caption value to "&&&" (without the quotes). For some reason, it looks like you need an extra ampersand in that instance.

With two ampersands, maybe it is something weird like one of them gets interpreted as concatenation with an implicit null string.
 

Users who are viewing this thread

Back
Top Bottom