Jump to content

Need help while using GUICtrlSetData


imani
 Share

Recommended Posts

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

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

Link to comment
Share on other sites

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")

Link to comment
Share on other sites

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")
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...