PDA

View Full Version : ampersand as part of button label


bhnh
03-31-2008, 10:53 PM
Any suggestions on having an ampersand ("&") in a button label... like an "M&M" button? Many thanks.

shibumenon
03-31-2008, 10:59 PM
rollout unnamedRollout "Untitled" width:158 height:104
(
button btn_MM "M&M" pos:[14,25] width:125 height:35
)

createDialog unnamedRollout


works fine

ZeBoxx2
04-01-2008, 01:01 AM
as aaaaCHoooo mentioned, should be fine on buttons.

On labels (and possibly some other controls), use '&&' instead; a single '&' gets interpreted as being a (useless, as it can't actually be invoked as such) hotkey tag otherwise

bhnh
04-01-2008, 07:39 AM
Aha! Thanks, Richard. That was driving me crazy.

susanta
04-01-2008, 11:34 AM
@ is non printing character. Please use \x40 for it.
example:
label lbl1 "\x40" pos:[30,21] width:93 height:45

bhnh
04-01-2008, 11:37 AM
Ah. Thank you, Susanta. I take there's list of these somewhere in the MAXScript Reference?

susanta
04-01-2008, 11:43 AM
there is this nice code on maxscript reference under String Literals topic which printout all of them.

char="0123456789abcdef"
for i=1 to char.count do
for j=1 to char.count do
(
s=execute("\"\\x"+char[i]+char[j]+"\"")
format "%% %\n" char[i] char[j] s
)

cheers

bhnh
04-01-2008, 12:29 PM
Sweet! Thank you. :thumbsup:

CGTalk Moderation
04-01-2008, 12:29 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.