Sign in to follow this  
Followers 0
Valuater

& sign in a label or button?

8 posts in this topic

cant seem to find it

i just want "hello & goodbye"

it works in a message box

$text = Chr(38)
MsgBox(0, "Test", "Hello " & $text & " Goodbye   ")

$Text = "Hello & Goodbye   " 
MsgBox(0, "Test", $text)

#include <GUIConstants.au3>

GUICreate("")

GUICtrlCreateButton( $text, 20, 20)
GUICtrlCreateLabel($text, 20, 50)
GUICtrlCreateLabel("Hello " & Chr(38) & " Goodbye   ", 20, 80)
GUICtrlCreateLabel('Hello " & " Goodbye   ', 20, 110)

GUISetState()

While 1
    Sleep(10)
WEnd

NEWHeader1.png

Share this post


Link to post
Share on other sites



$Text = "Hello & Goodbye   "

#include <GUIConstants.au3>

GUICreate("")

GUICtrlCreateButton( $text, 20, 20)
GUICtrlCreateLabel($text, 20, 50)
GUICtrlCreateLabel("Hello " & Chr(38) & Chr(38) & " Goodbye   ", 20, 80)
GUICtrlCreateLabel('Hello && Goodbye   ', 20, 110)

GUISetState()

While 1
    Sleep(10)
WEnd


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

thanks SmOke

funny... i never seemed to run into that one before

thanks again

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

No problem, I use it often is why I know more than likely... I think there was a thread on it about 8 or 9 months ago, and CyberSlug explained why (God help me if I remember why!! :o)


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

GUICtrlCreateLabel("Save & Exit", 10, 10, 80, 25, $SS_NOPREFIX)

$SS_NOPREFIX

Prevents interpretation of any ampersand (&) characters in the control’s text as accelerator prefix characters.

An application can combine SS_NOPREFIX with other styles by using the bitwise OR (|) operator. This can be useful when file names or other strings that might contain an ampersand (&) must be displayed within a static control in a dialog box.

edit: also works on buttons

Edited by pecloe

Share this post


Link to post
Share on other sites

thx.... pecloe

i will try to remember that one also

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

GUICtrlCreateLabel("Save & Exit", 10, 10, 80, 25, $SS_NOPREFIX)

$SS_NOPREFIX

Prevents interpretation of any ampersand (&) characters in the controls text as accelerator prefix characters.

An application can combine SS_NOPREFIX with other styles by using the bitwise OR (|) operator. This can be useful when file names or other strings that might contain an ampersand (&) must be displayed within a static control in a dialog box.

edit: also works on buttons

Yes, good stuff... But I am dissapointed in myself, I was thinking do I really want to type the extra 11 characters... how sad is that!

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

if you type like i do with one finger, less is better ha

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0