Liest den Text eines Edit-Controls aus
#include <GuiEdit.au3>
_GUICtrlEdit_GetText ( $hWnd )
$hWnd | Control-ID / Handle des Controls |
Erfolg: | ein String vom Edit-Control |
Fehler: | ein leerer String |
- - - - - - - - Erklärung der Controls - - - - - - - -
_GUICtrlEdit_AppendText, _GUICtrlEdit_GetTextLen, _GUICtrlEdit_SetText
#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>
#include <MsgBoxConstants.au3>
Example()
Func Example()
; Erstellt eine GUI
GUICreate("Edit: Setzt und ermittelt Text (v" & @AutoItVersion & ")", 400, 300)
Local $idEdit = GUICtrlCreateEdit("", 2, 2, 394, 268)
GUISetState(@SW_SHOW)
; Setzt den Text
_GUICtrlEdit_SetText($idEdit, "Dies ist ein Test" & @CRLF & "Eine andere Zeile" & @CRLF & "An das Ende anhängen?")
; Ermittelt den Text
MsgBox($MB_SYSTEMMODAL, "Information", _GUICtrlEdit_GetText($idEdit))
; Die Schleife wiederholt sich, bis der Benutzer die Beenden-Aktion der GUI auslöst.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example