Jump to content
Sign in to follow this  

need code to set text in edit box

Recommended Posts

I need code to set some text in an edit box control

_GUICtrlEdit_SetText($hedit, test)

Trying with the above function.

please advice how to make a stmt.

Share this post

Link to post
Share on other sites

You need to use GUIEdit.au3 and the text to be between ' '

Search for _GUICtrlEdit_SetText() example in help file.

When the words fail... music speaks

Share this post

Link to post
Share on other sites

Here an example:

#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>

Global $iMemo
$hGUI = GUICreate("Test", 640, 480)
$iMemo = GUICtrlCreateEdit("", 0, 0, 640, 480, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_READONLY)
GUICtrlSetLimit(-1, 0x7FFFFFFF)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")

$prg = "dir "
$parameter = @SystemDir & " /s"
$run = Run(@ComSpec & " /c " & $prg & $parameter, @ScriptDir, @SW_HIDE, $STDOUT_CHILD)

While 1
    $line = StdoutRead($run)
    If @error Then ExitLoop

While 1
    $Msg = GUIGetMsg()
    If $Msg = $GUI_EVENT_CLOSE Then ExitLoop

$save = MsgBox(4 + 32 + 256, "Save", "Save log?", 10)
If $save = 6 Then
    $file = FileSaveDialog("Save Log", @ScriptDir, "Log (*.log;*.txt)", 18)
    If Not @error Then
        $log = GUICtrlRead($iMemo)
        FileWrite($file, $log)

; Write a line to the memo control
Func MemoWrite($sMessage)
;~  GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
    GUICtrlSetData($iMemo, $sMessage, 1)
EndFunc ;==>MemoWrite



Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...