Jump to content

EditBox question


Recommended Posts

Hi to all, i want add in my application a "console" like the Scite's auotoit editor. Here i want to write all the operation that the application are doing. But the problem is that.

If i add the text with the GuiCtrlSetData, the guiedit it's delete the previus writed text, and add the new. There is a way to display in the editbox the entire texts digits?...a function like consolewrite but for guiedit?

Hi!

Edited by StungStang
Link to comment
Share on other sites

Help file, command _GUICtrlEdit_AppendText:

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiEdit.au3>
#include <GuiConstantsEx.au3>

Opt('MustDeclareVars', 1)

$Debug_Ed = False ; Check ClassName being passed to Edit functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()
    Local $hEdit

    ; Create GUI
    GUICreate("Edit Append Text", 400, 300)
    $hEdit = GUICtrlCreateEdit("This is a test" & @CRLF & "Another Line", 2, 2, 394, 268)
    GUISetState()

    _GUICtrlEdit_AppendText($hEdit, @CRLF & "Append to the end?")
    
    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main

you can also use this:

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>

Opt('MustDeclareVars', 1)

_Main()

Func _Main()
    Local $hEdit

    ; Create GUI
    GUICreate("Edit Append Text", 400, 300)
    $hEdit = GUICtrlCreateEdit("This is a test" & @CRLF & "Another Line", 2, 2, 394, 268)
    GUISetState()

    ;setting data by reading it and adding new line:
    GUICtrlSetData($hEdit, GUICtrlRead($hEdit) & @CRLF & 'Append to the end?')

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main

but I would recommend _GUICtrlEdit_AppendText becase this last option is slower when your edit has lots of characters

Edited by dragan
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...