How to include ampersand (&) in button text

M

milop

Hello.

How do I set the Text property of a button so that an ampersand (&) is
displayed?

Thanks,

Mike
 
R

Rudy Velthuis

milop said:
Hello.

How do I set the Text property of a button so that an ampersand (&)
is displayed?

IIRC, you should use "Copy && Paste" instead of "Copy & Paste". The
"&&" should display as "&".
 
R

Rudy Velthuis

milop said:
Hello.

How do I set the Text property of a button so that an ampersand (&)
is displayed?

IIRC, you should use "Copy && Paste" instead of "Copy & Paste". The
"&&" should display as "&".
 
H

Herfried K. Wagner [MVP]

milop said:
How do I set the Text property of a button so that an ampersand (&) is
displayed?

The character followed by the "&" character is treated as the control's
mnemonic. If you press the Alt key on the form, this character will be
displayed with an underline. Just write "&&" to display an ampersand
character in the button's text.

BTW: The label control comes with a 'UseMnemonic' property, which, if set
to 'False', will cause every single ampersand character to be displayed on
the label.
 
H

Herfried K. Wagner [MVP]

milop said:
How do I set the Text property of a button so that an ampersand (&) is
displayed?

The character followed by the "&" character is treated as the control's
mnemonic. If you press the Alt key on the form, this character will be
displayed with an underline. Just write "&&" to display an ampersand
character in the button's text.

BTW: The label control comes with a 'UseMnemonic' property, which, if set
to 'False', will cause every single ampersand character to be displayed on
the label.
 
M

milop

Thanks Herfried.

Herfried K. Wagner said:
The character followed by the "&" character is treated as the control's
mnemonic. If you press the Alt key on the form, this character will be
displayed with an underline. Just write "&&" to display an ampersand
character in the button's text.

BTW: The label control comes with a 'UseMnemonic' property, which, if set
to 'False', will cause every single ampersand character to be displayed on
the label.
 
M

milop

Thanks Herfried.

Herfried K. Wagner said:
The character followed by the "&" character is treated as the control's
mnemonic. If you press the Alt key on the form, this character will be
displayed with an underline. Just write "&&" to display an ampersand
character in the button's text.

BTW: The label control comes with a 'UseMnemonic' property, which, if set
to 'False', will cause every single ampersand character to be displayed on
the label.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top