Opt("GUIOnEventMode", 1)
#include <GUIConstants.au3>
Global $Inp[5], $Chk = 0
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 525, 136, 193, 125)
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
$Inp[0] = GUICtrlCreateInput("", 32, 56, 89, 21)
$Inp[1] = GUICtrlCreateInput("", 128, 56, 89, 21)
$Inp[2] = GUICtrlCreateInput("", 224, 56, 89, 21)
$Inp[3] = GUICtrlCreateInput("", 320, 56, 81, 21)
$Inp[4] = GUICtrlCreateInput("", 408, 56, 81, 21)
For $I = 0 To 4
GUICtrlSetLimit($Inp[$I], 5)
Next
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
If $Chk = 0 Then ChkInp()
Sleep(100)
WEnd
Func ChkInp()
Local $I
For $I = 4 To 0 Step - 1
If StringLen(GUICtrlRead($Inp[$I])) = 5 Then
If $I = 4 Then
MsgBox(0, 0, GUICtrlRead($Inp[0]) & "-" & GUICtrlRead($Inp[1]) & "-" & GUICtrlRead($Inp[2]) _
& "-" & GUICtrlRead($Inp[3]) & "-" & GUICtrlRead($Inp[4]))
$Chk = 1
ExitLoop
EndIf
If StringLen(GUICtrlRead($Inp[$I + 1])) = 0 Then
GUICtrlSetState($Inp[ $I + 1 ], $GUI_Focus)
ExitLoop
EndIf
EndIf
If $I = 0 And StringLen(GUICtrlRead($Inp[$I])) = 0 Then GUICtrlSetState($Inp[ $I ], $GUI_Focus)
Next
EndFunc ;==>ChkInp
Func quit()
Exit
EndFunc ;==>quit
不知这个能达到楼主想要的效果么?没什么间,所以没注解。如果其中的某个地方不清楚,楼主可以跟贴问我。
[
[ 本帖最后由 漠北雪~狼 于 2008-5-12 10:45 编辑 ] |