2017-11-02 5 views
0

GUICtrlCreateEdit()に挿入するにはどうすればよいですか? Documentation - Function Reference - GUICtrlSetData() 1としてGUICtrl要素へのConsoleWrite()

Images

#include <EditConstants.au3> 
#include <GUIConstantsEx.au3> 
$Form1 = GUICreate("Test", 257, 182, 192, 124) 
GUISetFont(12, 400, 0, "Times New Roman") 
$test = GUICtrlCreateEdit("", 8, 40, 241, 90, $ES_AUTOVSCROLL) 
GUISetState(@SW_SHOW) 

While 1 
    $nMsg = GUIGetMsg() 
    Switch $nMsg 
     Case $GUI_EVENT_CLOSE 
      Exit 
    EndSwitch 
WEnd 

ConsoleWrite('Text test') 

答えて

0

は、制御用のデータを変更します。

例:私はGUICtrlCreateEdit()ConsoleWrite()を置くことができますどのように

#include <EditConstants.au3> 
#include <GUIConstantsEx.au3> 

$Form1 = GUICreate("Test", 257, 182, 192, 124) 
$test = GUICtrlCreateEdit("", 8, 40, 241, 90, $ES_AUTOVSCROLL) 
GUISetState(@SW_SHOW) 

While 1 
    $nMsg = GUIGetMsg() 
    Switch $nMsg 
     Case $GUI_EVENT_CLOSE 
      GUICtrlSetData($test, 'Shutting down in 5 seconds ...') 
      Sleep(5 * 1000) 
      Exit 
    EndSwitch 
WEnd 

例:

#include <EditConstants.au3> 
#include <GUIConstantsEx.au3> 

$Form1 = GUICreate("Test", 257, 182, 192, 124) 
$test = GUICtrlCreateEdit("", 8, 40, 241, 90, $ES_AUTOVSCROLL) 
GUISetState(@SW_SHOW) 

While 1 
    $nMsg = GUIGetMsg() 
    Switch $nMsg 
     Case $GUI_EVENT_CLOSE 
      ConsoleWriteGUI($test, 'Shutting down in 10 seconds ...' & @CRLF) 
      Sleep(5 * 1000) 
      ConsoleWriteGUI($test, '5 more seconds ...' & @CRLF) 
      Sleep(5 * 1000) 
      Exit 
    EndSwitch 
WEnd 

Func ConsoleWriteGUI(Const ByRef $hConsole, Const $sTxt) 
    Local Static $sContent = '' 

    $sContent &= $sTxt 
    GUICtrlSetData($hConsole, $sContent) 

EndFunc 
関連する問題