Jump to content

GUICtrlSetData ONLY insert ? Not clear old data ?


Go to solution Solved by mpower,

Recommended Posts

#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,
 

Link to post
Share on other sites
  • Solution

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
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...