Jump to content

& sign in a label or button?


Valuater
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

$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

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.

Link to comment
Share on other sites

  • Moderators

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)

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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!

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...