ampersand in a button label

ampersand in a button label

bhnh
Advocate Advocate
380 Views
4 Replies
Message 1 of 5

ampersand in a button label

bhnh
Advocate
Advocate
Any suggestions on having an ampersand ("&") in a button label... like an "M&M" button? Many thanks.
0 Likes
381 Views
4 Replies
Replies (4)
Message 2 of 5

bhnh
Advocate
Advocate
Oops. Wrong example... the problem is with labels. Try this...
rollout test "test" (
label test1 "M&M"
)
createdialog test

Rather than getting "M&M" I'm getting "MM".
0 Likes
Message 3 of 5

bhnh
Advocate
Advocate
Problem solved. In a label you need to use a double-ampersand (&&), otherwise it's read as a hotkey tag.
0 Likes
Message 4 of 5

Steve_Curley
Mentor
Mentor
You beat me to it again...

The Ampersand (single) causes the next character to be underlined (though there's a windows "feature" which disables this) and causes the underlined key to become the "hotkey" (shortcut) for that object. 2 Ampersands displays a single one as you found - effectively an escape sequence. Useful on buttons, spinner labels, radio button text etc, not so useful on a Label as a Label doesn't actually do anything 😛

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 5 of 5

bhnh
Advocate
Advocate
Thanks, my friend. I learn slowly, but I do learn. :coolgrin:
0 Likes