Sign in to follow this  
Followers 0
skippynz

GuiCtrlCreateLabel doesnt display ampersands

4 posts in this topic

when i try to use text with an ampersand in it a message box will display the text correctly however a guictrlcreatelabel does not. does anyone have an idea how i can get this to display correctly all the time in guictrlcreatelabel ?

the text in $test is pulled from an sql server but below i have just displayed the issue.

thanks

Craig

CODE
#include <GUIConstants.au3>

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

GUISetHelp("notepad") ; will run notepad if F1 is typed

Opt("GUICoordMode",2)

$test = "test 1 & 2 & 3"

GUICtrlCreateLabel ($test,10,10,100) ; first cell 70 width

GUISetState () ; will display an empty dialog box

msgbox(0,'test',$test)

; Run the GUI until the dialog is closed

Do

$msg = GUIGetMsg()

Until $msg = $GUI_EVENT_CLOSE

Share this post


Link to post
Share on other sites



#include <GUIConstantsEx.au3>

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

GUISetHelp("notepad") ; will run notepad if F1 is typed
Opt("GUICoordMode",2)

$test = "test 1 && 2 && 3"
GUICtrlCreateLabel ($test,10,10,100) ; first cell 70 width

GUISetState () ; will display an empty dialog box

; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE


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.

Share this post


Link to post
Share on other sites

LEGEND - thanks for the quick reply SmokeN - that did the trick

#include <GUIConstantsEx.au3>

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

GUISetHelp("notepad") ; will run notepad if F1 is typed
Opt("GUICoordMode",2)

$test = "test 1 && 2 && 3"
GUICtrlCreateLabel ($test,10,10,100) ; first cell 70 width

GUISetState () ; will display an empty dialog box

; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE

Share this post


Link to post
Share on other sites

Add style $SS_NOPREFIX to the label. GUICtrlCreateLabel ($test,10,10,100,-1,$SS_NOPREFIX)

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