Sign in to follow this  
Followers 0
ainner

Is there a way to display multiple lines of text with GUICtrlCreateLabel

4 posts in this topic

I would like to be able to write multiple lines of text without using 1 GUICtrlCreateLabel for each line. Is there a way to do a carriage return code inside the caption ?

Thx for the help !

#include <GUIConstants.au3>

; == GUI generated with Koda ==

$Form1 = GUICreate("AForm1", 682, 436, 209, 155)

GUISetBkColor(0xFFFFFF)

$Pic1 = GUICtrlCreatePic("\\m3sapp01\DATAZEN\AutoItFn\Images-a-Compiler\MSSSi2d.jpg", 8, 8, 298, 114)

GUICtrlCreateLabel("Installation d'Acrobat Writer 7.0", 152, 144, 365, 33)

GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")

GUICtrlCreateLabel("THIS IS MY FIRST LINE OF TEXT", 160, 216, 343, 28)

GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")

$Button1 = GUICtrlCreateButton("HERE IS MY SECOND LINE", 136, 320, 145, 41, $WS_BORDER)

GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")

$Button2 = GUICtrlCreateButton("HERE IS THE THIRD", 400, 320, 145, 41, $WS_BORDER)

GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")

Share this post


Link to post
Share on other sites



like this

GUICtrlCreateLabel("THIS IS MY FIRST LINE OF TEXT" & @CRLF & "THIS IS A SECOND LINE OF TEXT", 160, 216, 343, 58)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Thx a lot for your anwer... I finally decided to use multiple labels since it's easier to format the text.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Or if formatting concerns you:

GUICtrlCreateLabel("THIS IS MY FIRST LINE OF TEXT" & @CRLF & _
                   "THIS IS A SECOND LINE OF TEXT" & @CRLF & _
                   "THIS IS A THIRD LINE OF TEXT" & @CRLF & _
                   "THIS IS MY LAST LINE OF TEXT", 160, 216, 343, 58)

Edit: Typo's Duh!!

Edited by PartyPooper

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