Sign in to follow this  
Followers 0
Saagar

need code to set text in edit box

4 posts in this topic

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



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

_GUICtrlEdit_SetText($hedit, test)

Hello,

You should take a look to GUICtrlSetData

Regards,

sahsanu

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

#4 ·  Posted (edited)

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

$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
    MemoWrite($line)
Wend

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

$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)
        FileClose($file)
    EndIf
EndIf
Exit

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

BR,

UEZ

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  
Followers 0