Jump to content
Sign in to follow this  
nikolajp

Several lines of text on a button.

Recommended Posts

nikolajp

I am trying to fit it all into my GUI, and it would help so much to have several lines of text on some buttons.

I can't figure out how to do it.

I tried this..

$Button = GUICtrlCreateButton("line1" & @CRLF & "line2", 1, 1, 130, 50)

But it did not work. It only showed a strange text-symbol for the carriage return (@CRLF)

Any ideas?

I love the AutoIt program.. what a tool!

.nikolaj

Share this post


Link to post
Share on other sites
smashly

Hi

#include <GUIConstants.au3>

$Gui = GUICreate("Multiline Button", 200, 200)
$Button = GUICtrlCreateButton("Heaps of text can fit on one button" & @CR & "if you use the control style " & _
                                "$BS_MULTILINE" & @CR & "when creating your button." & @CR & _
                                "CLICK TO CONTINUE..", 10, 10, 180, 80, $BS_MULTILINE)
GUISetState(@SW_SHOW, $Gui)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $Button 
            GUICtrlSetData($Button, "Is this the information you've been looking for?" & @CR & "O   O" & _
                                       @CR & "   V   " & @CR & "\______/")
    EndSelect
WEnd

Cheers

Share this post


Link to post
Share on other sites
nikolajp

Thank you very much!

.nikolaj

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  

×