本帖最后由 qq342252004 于 2009-12-21 08:32 编辑 #include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 230, 218, -1, -1)
$Edit1 = GUICtrlCreateEdit("", 16, 16, 200, 129,BitOR($ES_AUTOVSCROLL,$ES_READONLY,$WS_VSCROLL))
GUICtrlSetData(-1, "Edit1")
$Button1 = GUICtrlCreateButton("显示时间", 20, 168, 75, 25, 0)
$Button2 = GUICtrlCreateButton("退出", 120, 168, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Timer()
Case $Button2
Exit
EndSwitch
WEnd
Func Timer()
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒111111111111111111111")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒2222222222")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒33333333333333333333333333333333333333")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒5555555555555555555555555555555555")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒5555555555555555555")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒5555555555555555555555555555555555555555555555")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
exit
EndFunc
Func Addlog ($lcStr)
GUICtrlSetData($Edit1,GUICtrlRead($Edit1)&@CRLF&$lcStr)
GUICtrlSetData($Edit1," ",True)
EndFunc
如何让edit显示的内容不自动换行? |