$Form1 = GUICreate("Form1", 473, 141, 1643, 207)
按这一句看,你的屏幕真的是很宽啊!!!
While 1
;MsgBox(0,"test","hello")
du()
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button2
ExitLoop
EndSwitch
;Sleep(30000) 这个Sleep 加的相当无聊啊!帮助没看清!
WEnd
修改后可以正常运行的:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 473, 141)
$Progress1 = GUICtrlCreateProgress(15, 72, 433, 41)
$Button1 = GUICtrlCreateButton("Run", 48, 16, 121, 41, 0)
GUICtrlSetFont(-1, 10, 800, 0, "Verdana")
$Button2 = GUICtrlCreateButton("Stop", 280, 16, 121, 41, 0)
GUICtrlSetFont(-1, 10, 800, 0, "Verdana")
GUISetState()
#EndRegion ### END Koda GUI section ###
;$mdb_data_path="D:\home\Training\ASPX\CCC\SCVData\DataAdmin.mdb"
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
While 1
;MsgBox(0,"test","hello")
du()
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button2
ToolTip("")
ExitLoop
EndSwitch
;Sleep(30000) 注意不要有这个!
WEnd
Case $Button2
Exit
EndSwitch
WEnd
Func du()
ToolTip("测试运行..." & @SEC)
;$addfld = ObjCreate("ADODB.Connection")
;$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &$mdb_data_path)
;$RS =ObjCreate("ADODB.Recordset")
;$RS.ActiveConnection = $addfld
;$RS.Open ("Select * From test where runFlag='Y'")
;while Not $RS.eof And Not $RS.bof
;if @error =1 Then ExitLoop
;GUICtrlCreateListViewItem ( $RS.Fields (0).value&"|"& $RS.Fields (1).value&"|"& $RS.Fields (2).value&"|"& $RS.Fields (3).value&"|"& $RS.Fields (4).value,$ListView1 )
; $sQuery ="update test set runFlag='N' WHERE uid="& $RS.Fields(0).value
; $addfld.execute($sQuery)
; ;$RS("runFlag")="N"
;$rs.update
; MsgBox(0, "", $RS.Fields (2).value);显示表第一个数据
; $rs.movenext
;WEnd
; $rs.close
; $addfld.Close
EndFunc
[ 本帖最后由 liongodmien 于 2008-9-27 11:36 编辑 ] |