回复 1# smooth
如下代码: (主要是函数 _GUICtrlEdit_AppendText 的应用)
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>
Opt("GUIOnEventMode", 1)
Global $start=False
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Edit显示例子", 365, 532, 192, 114)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Edit1 = GUICtrlCreateEdit("", 8, 8, 353, 409)
$Button1 = GUICtrlCreateButton("Start", 96, 448, 153, 49)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(500)
If $start Then _GUICtrlEdit_AppendText($Edit1,"my test text"&Random()&@CRLF)
WEnd
Func Button1Click()
$start=Not $start
If $start Then
GUICtrlSetData($Button1,"Stop")
Else
GUICtrlSetData($Button1,"Start")
EndIf
EndFunc
Func Form1Close()
Exit
EndFunc
|