#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>
#include <GuiConstantsEx.au3>
Local $k=20
#Region ### START Koda GUI section ### Form=c:\users\administrator\desktop\test.kxf
$Form1_1 = GUICreate("Form1", 298, 100, 450, 339)
$Input1 = GUICtrlCreateInput("password", 88, 16, 137, 21, $ES_PASSWORD)
$Checkbox1 = GUICtrlCreateCheckbox("显示密码", 8, 8, 73, 33)
$Button1 = GUICtrlCreateButton("运行倒计时", 8, 56, 217, 33)
$Button2 = GUICtrlCreateButton("确定", 240, 16, 49, 73)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Checkbox1
If GUICtrlRead($Checkbox1) = 4 Then
_GUICtrlEdit_SetPasswordChar($Input1, "*")
GUICtrlSetState($Input1, $GUI_FOCUS)
Else
_GUICtrlEdit_SetPasswordChar($Input1)
GUICtrlSetState($Input1, $GUI_FOCUS)
EndIf
Case $Button2
if GUICtrlRead($Button2)="确定" Then
AdlibRegister("time",1000)
GUICtrlSetData($Button2,"取消")
time()
Else
AdlibUnRegister("time")
GUICtrlSetData($Button1,"运行倒计时")
GUICtrlSetData($Button2,"确定")
$k=20
EndIf
EndSwitch
WEnd
func time()
if $k<1 Then
AdlibUnRegister("time")
Exit
EndIf
GUICtrlSetData($Button1,"运行倒计时"&$k)
$k-=1
EndFunc
|