Jump to content

GUICtrlSetData($input, Read($input) & @CR & "more"


andguent
 Share

Recommended Posts

I searched around for a while and could not find the answer to this simple question.

I want to append text to the bottom of a GUI input box.

I want the new data on a new line. This code below is supposed to add a number every second, on a new line every time. It does add the number, but no new line/carriage return.

As you can see, I tried a few different special characters in hopes that one of them would work. Any ideas would be greatly appreciated.

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1) ; Change to OnEvent mode
$debugwindow = GUICreate("Process Info", 200, 100)

$inputMainDisplay = GUICtrlCreateInput("", 10, 10, 180, 80)
GUICtrlSetState($inputMainDisplay, $GUI_DISABLE)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUISetState(@SW_SHOW)

Local $count = 1

While 1
  Sleep(1000) ; Idle around
  GUICtrlSetData($inputMainDisplay, GUICtrlRead($inputMainDisplay) & " " & Chr(11) & @CR & @LF & @CRLF & $count & " ")
  $count = $count + 1
WEnd

Func CLOSEClicked()
  Exit
EndFunc
Link to comment
Share on other sites

  • Developers

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1); Change to OnEvent mode
$debugwindow = GUICreate("Process Info", 200, 100)

$inputMainDisplay = GUICtrlCreateInput("", 10, 10, 180, 80,$ES_MULTILINE )
GUICtrlSetState($inputMainDisplay, $GUI_DISABLE)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUISetState(@SW_SHOW)

$count = 1

While 1
  Sleep(1000); Idle around
  GUICtrlSetData($inputMainDisplay, GUICtrlRead($inputMainDisplay) & $count & @CRLF)
  $count = $count + 1
WEnd

Func CLOSEClicked()
  Exit
EndFunc

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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