GuiCtrlCreateEdit & GuiCtrlSetData Question! :)

6 posts in this topic


When utilizing GUICtrlSetData to edit what is displayed in a GUICtrlCreateEdit field, is there a way to just make it write new lines rather than clearing what's there and writing the new information?

For example ... 

GUICtrlSetData ($editField, "Line one"&@CRLF ,  "")
GUICtrlSetData ($editField, "Line two"&@CRLF ,  "")
GUICtrlSetData ($editField, "Line three"&@CRLF ,  "")

What happens now if those three things run one after another, the Edit field displays "Line One" , then that is replaced with "Line Two" and so on with the previous information disappearing and the subsequent taking its place. I'd like for it to say all three, one after another. Any documents on how I may accomplish this?



Share this post

Link to post
Share on other sites


Use the GUlEdit UDF - the _GUICtrlEdit_AppendText function is the one you want.


1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites

Hello there!

Melba23, that sounds just peachy! Trouble I am having now is locating the UDF. I searched the forums for that name and I went through the Wiki ( ) . I feel like I am once again over looking something plainly obvious... If it's not too much trouble could you spare the time to provide a link? Thanks a bunch!


Share this post

Link to post
Share on other sites

@Reizvoller just do a search in the help file for _GuiCtrlEdit_AppendText. If you have the current version of AutoIt, it's in there ;)

√-1 2^3 ∑ π, and it was delicious!

Share this post

Link to post
Share on other sites

Read the help file more carefully. The last parameter of GUICtrlSetData can't be an empty string if you want to append to the text there already.

;~ Change this line
GUICtrlSetData ($editField, "Line three"&@CRLF ,  "")
:` To this
GUICtrlSetData ($editField, "Line three"&@CRLF ,  "x") ; the last parameter can be anything as long as it's not an empty string.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post

Link to post
Share on other sites

Ohh! I thought it was an external UDF I had to download. haha , thank you for the clarification :)

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

  • Similar Content

    • Jibberish
      By Jibberish
      I am working on a Video Player Test Script. I am reading a text file into a 3d array to be displayed in a GUI.
      Array Content:
      [x][1]UsageCount -> Up to a 4 digit number
      [x][2]EnableUsageCount (True/False)
      In the GUI the user can check the filename box, edit the number of usages and check EnableUsageCount to turn on the UsageCount control using the UsageCount number for the maximum number of plays.
      To make this easier to deal with I have removed the EnableUsageCount section, and am just concentrating on getting a method to put the edited (or unchanged) UsageCount in the array. Currently nothing is read into the array, due to my using the wrong method in the Case statement.
      Here are code snippets of what I am trying to do:
      ; Snippets from script ; I read the text file at the bottom and put the .mp4 filenames in $aManifest[x][0] and UsageCount in $aManifest[x][1] ; Then I create a GUI to display the .mp4 filenames with checkboxes and the UsageCount to the right. UsageCount is editable by the user. ; If the filename is checked, I want to read the filename into $aCheckedVideos[x][0] and the updated UsageCount in $aCheckedVideos[x][1] ; The GUICtrlRead($aVideoName[$i]) with Case $GUI_CHECKED & UNCHECKED works for the checkboxes ; This section puts the filenames in the GUI with a checkbox For $i = 0 to $iMMCount Step 1 $sMP4Text = $aManifest[$i][0] $iMP4Length = StringLen($sMP4Text) $aVideoName[$i] = GUICtrlCreateCheckbox($sMP4Text,$iLeft, $iTop) $iTop += 30 Next ; This section reads numbers from the Manifest array, and I want to be able to change the number and have them saved. ; So the Case $GUI_CHECKED & UNCHECKED won't work here, and I can't figure out what I should be doing here. For $i = 0 to $iMMCount Step 1 $sUsageText = $aManifest[$i][1] $aUsageCount[$i] = GUICtrlCreateInput($sUsageText,$iLeft, $iTop, 50,18, $GUI_DOCKAUTO) GUICtrlSetPos($aUsageCount[$i],200) $iTop += 30 Next While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idCloseGUI For $i = 0 To $iMMNewCount Step 1 Switch GUICtrlRead($aVideoName[$i]) Case $GUI_CHECKED $aCheckedVideos[$i][0] = $aManifest[$i][0] ; If checked, I put the results into a two D array Case $GUI_UNCHECKED ; where Video Name is $aCheckedVideos[x][0] EndSwitch Switch GUICtrlRead($aUsageCounter[$i]) Case $GUI_CHECKED $aCheckedVideos[$i][1] = $aUsageCount[$i] ;I want to put the text (numbers) in $aCheckedVideos[x][1] Case $GUI_UNCHECKED ;but what is returned is blank, probably due to EndSwitch ; $GUI_CHECKED being the wrong thing. Next ExitLoop EndSwitch WEnd ;The txt file I'm reading has the following: ;~ /** Title #1: Big Buck Bunny 1080p **/ ;~ "Name": "Big Buck Bunny", ;~ "URI": "..\\MediaFiles\\bbb_1080_60s.mp4", ;~ "UsageCount": 9999, ;~ "URI": "..\\MediaFiles\\bbb_1080_60s_enc1.mp4", ;~ "UsageCount": 45, ;~ "URI": "..\\MediaFiles\\bbb_1080_60s_enc1.mp4", ;~ "UsageCount": 2, ;~ /** Title #2: Tears of Steel 4K **/ ;~ "Name": "Tears of Steel 4K", ;~ "URI": "..\\MediaFiles\\tos_4K_60s_HEVC.mp4", ;~ "UsageCount": 9876, ;~ "URI": "..\\MediaFiles\\tos_4K_60s_HEVC_enc2.mp4", ;~ "UsageCount": 0, ;~ "URI": "..\\MediaFiles\\tos_4K_60s_HEVC_enc2.mp4", ;~ "UsageCount": 5, I am certain that the section
                          Switch GUICtrlRead($aUsageCounter[$i])
                              Case $GUI_CHECKED
                                  $aCheckedVideos[$i][1] = $aUsageCount[$i]    ;I want to put the text (numbers) in $aCheckedVideos[x][1]
                              Case $GUI_UNCHECKED                                ;but what is returned is blank, probably due to
                          EndSwitch                                            ; $GUI_CHECKED being the wrong thing.

      is wrong, and this is what I am looking for help with. Instead of $GUI_CHECKED what should I be looking for?
      The worst part of this is I had this working late last night, and then lost my changes and cannot for the life of me remember how I had this working.
      Help is truly appreciated!
    • 232showtime
      By 232showtime
      im getting strange output in array display,$split_[1] is not properly aligned to other arrays and why guictrlsetdata is not writting any data if i put comma(,) at the end of the text in $Input1???
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #Region ### START Koda GUI section ### Form=C:\Users\user\Desktop\Script\StringSplit.kxf $Form1 = GUICreate("Form1", 623, 449, 192, 114) $Input1 = GUICtrlCreateInput("50UGITQ421X, 50UGITQ422X, 50UGITQ423X, 50UGITQ427X, 50UGITQ431X, 50UGITQ435X, 50UGITQ436X, 50UGITQ437X, 50UGITQ441X, 50UGITQ445X, 50UGITQ449X, 50UGITQ453X, 50UGITQ454X, 50UGITQ455X, 50UGITQ459X", 24, 16, 553, 21) $Split = GUICtrlCreateButton("Split", 24, 48, 75, 25) $List1 = GUICtrlCreateList("", 24, 96, 553, 97) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Split $read = GUICtrlRead($Input1) $split_ = StringSplit($read, ",") $Max = UBound($split_, 1) For $i = 1 To UBound($split_) - 1 ConsoleWrite($split_[$i] & @CRLF) ;~ ControlSetText($Form1, "", $List1, $split_[$i]) GUICtrlSetData($List1, $split_[$i]) ;~ GUICtrlSetData($List1, $split_[$i]) ;~ GUICtrlSetData($List1, $i) Next _ArrayDisplay($split_) EndSwitch WEnd  
    • XOblivion
      By XOblivion
      im some what new to autoit and need help figuring out best way to make a simple clicker for few idle games i play(taptitdue, sakura clicker, elndless frontier etc.) ive played around with autoit recorder to make simple copy mouse clicks. but now i want to make a script that allows me to select multiple functions before starting the script for game ex: click section A or click section A + B to run At set intervals if that makes sense . i dont need scripts made by other just info on what things i should use to make it my self.
      need to be able to select between games and be able to select multiple functions to run inconjuntion or independent for each game. thank you in advance
    • rootx
      By rootx
      I hope someone explain me how to do that... well, if you run the command netstat -a inside cmd prompt he look nice( indented ) but if you try to show the output inside the GUICtrlCreateEdit he look without indentation... how can I  fix it? Thx
      $Pid = Run(@ComSpec & " /c " & "netstat -a",@ScriptDir,@SW_HIDE,$STDERR_CHILD + $STDOUT_CHILD) Dim $_StderrRead='', $_StdoutRead='', $_StdReadAll='' While ProcessExists ( $Pid ) $_StderrRead = StderrRead ( $Pid ) If Not @error And $_StderrRead <> '' Then GUICtrlSetData($Edit1, "Error: " & $_StderrRead & @Crlf ,1) EndIf $_StdoutRead = StdoutRead ( $Pid ) If Not @error And $_StdoutRead <> '' Then GUICtrlSetData($Edit1, "Log: " & $_StdoutRead & @Crlf ,1) EndIf Wend  
    • rootx
      By rootx
      How can I write a good output inside Edit control?
       4 example on notepad (windows) he looks terrible... but he looks perfect on notepad++ and cmd. THX
      GUICtrlSetData($Edit1, "Log: " & $_StdoutRead & @Crlf ,1) the log..