Jump to content
Sign in to follow this  
imani

Need help while using GUICtrlSetData

Recommended Posts

imani

Look in the following code. When I press the button 1 then I want to display the following output in the GUIctrlCreateedit window

Output

Line 1

Line 2

Line 3

I do want to add some functions before and after the GUICtrlSetData commands (Can not use @CRLF)

#include <GUIConstants.au3>
#NoTrayIcon

Global $mainwin= GUICreate("Utility 3.1.1", 270,250)
GUISwitch($mainwin)
$Button_1 = GuiCtrlCreateButton("Button1", 40, 20, 170, 30)
GUICtrlSetState($Button_1,$GUI_FOCUS)
$Button_2 = GuiCtrlCreateButton("Button2", 40, 60, 170, 30)
$Button_3 = GuiCtrlCreateButton("Button3", 40, 100, 170, 30)
$exit = GuiCtrlCreateMenu ("File")
$exititem = GUICtrlCreateMenuitem ("Exit",$exit)
$helpmenu = GuiCtrlCreateMenu ("Help")
$readmeitem = GuiCtrlCreateMenuitem ("Readme",$helpmenu)
$aboutitem = GuiCtrlCreateMenuitem ("About",$helpmenu)
$edit = GUICtrlCreateEdit("",0,150,270,80,BitOR($ES_READONLY,$ES_MULTILINE),$WS_EX_STATICEDGE)


GUISetState ()   
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button_1
            GUICtrlSetData($edit,"Line 1")
                                                ;I want to put separate function here
            GUICtrlSetData($edit,"Line 2")
                                                ;I want to put separate function here
            GUICtrlSetData($edit,"Line 3")

        Case $msg = $Button_2   

        Case $msg = $Button_3

        Case $msg = $exititem

            ExitLoop
        Case $msg = $aboutitem

        Case $msg = $readmeitem

    EndSelect
Wend
Edited by imani

Share this post


Link to post
Share on other sites
smashly

Hi,

Replace

GUICtrlSetData($edit,"Line 1")

            GUICtrlSetData($edit,"Line 2")

            GUICtrlSetData($edit,"Line 3")oÝ÷ Ùh­«­¢+ÙU%
ÑɱMÑÑ ÀÌØí¥Ð°ÅÕ½Ðí1¥¹ÄÅÕ½ÐìµÀì
I1µÀìÅÕ½Ðí1¥¹ÈÅÕ½ÐìµÀì
I1µÀìÅÕ½Ðí1¥¹ÌÅÕ½Ðì¤
Cheers

Share this post


Link to post
Share on other sites
smashly

Hi again,

GUICtrlSetData($edit,"Line 1")
                                                ;I want to put separate function here
            GUICtrlSetData($edit, GUICtrlRead($edit) & @CRLF & "Line 2")
                                                ;I want to put separate function here
            GUICtrlSetData($edit, GUICtrlRead($edit) & @CRLF & "Line 3")

Cheers

Share this post


Link to post
Share on other sites
imani

Hi again,

GUICtrlSetData($edit,"Line 1")
                                                ;I want to put separate function here
            GUICtrlSetData($edit, GUICtrlRead($edit) & @CRLF & "Line 2")
                                                ;I want to put separate function here
            GUICtrlSetData($edit, GUICtrlRead($edit) & @CRLF & "Line 3")

Cheers

A simple method to do so

GUICtrlSetData($edit,"Line 1","append")

GUICtrlSetData($edit,@CRLF & "Line 2","append")

GUICtrlSetData($edit,@CRLF & "Line 3","append")

Share this post


Link to post
Share on other sites
imani

Hi again,

GUICtrlSetData($edit,"Line 1")
                                                ;I want to put separate function here
            GUICtrlSetData($edit, GUICtrlRead($edit) & @CRLF & "Line 2")
                                                ;I want to put separate function here
            GUICtrlSetData($edit, GUICtrlRead($edit) & @CRLF & "Line 3")oÝ÷ Ø(^?ªê-x"^ëa¡Ûhv(jëh×6         GUICtrlSetData($edit,"Line 1","append")

            GUICtrlSetData($edit,@CRLF & "Line 2","append")

            GUICtrlSetData($edit,@CRLF & "Line 3","append")

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.