Jump to content
Sign in to follow this  
VIP

GUICtrlSetData ONLY insert ? Not clear old data ?

Recommended Posts

VIP

#include <GUIConstants.au3>

Global $EditBufSize = 281474976710656

$MainGUI = GUICreate("Test", 620, 300 )
$GUI_Log=GUICtrlCreateEdit ("", 20,20,600,200, BitOR($ES_NOHIDESEL,$ES_AUTOVSCROLL,$ES_READONLY, $WS_HSCROLL,$WS_VSCROLL, $ES_MULTILINE))

GUISetState ()
    GUICtrlSetData ($GUI_Log, "Hello" & @CRLF,1)
    GUICtrlSetData ($GUI_Log, "World" & @CRLF,1)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

Exit 

Why "Hello" not Delete ?

 

Edited by Trong

Regards,
 

Share this post


Link to post
Share on other sites
mpower

You answer is here: https://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetData.htm

default [optional]
Combo, List: The default value.
Edit, Input: If non-empty (""), the string is inserted at the current insertion point (caret).

#include <GUIConstants.au3>

Global $EditBufSize = 281474976710656

$MainGUI = GUICreate("Test", 620, 300 )
$GUI_Log=GUICtrlCreateEdit ("", 20,20,600,200, BitOR($ES_NOHIDESEL,$ES_AUTOVSCROLL,$ES_READONLY, $WS_HSCROLL,$WS_VSCROLL, $ES_MULTILINE))

GUISetState ()
    GUICtrlSetData ($GUI_Log, "Hello" & @CRLF)
    GUICtrlSetData ($GUI_Log, "World" & @CRLF)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

Exit
Edited by mpower
  • Like 1

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.