xlcwxl 发表于 2010-1-24 22:24:01

进度条循环运行

怎样让进度条循环运行(假进度条),当程序结束时自动关闭?

afan 发表于 2010-1-24 22:33:26

用图片拼~

顽固不化 发表于 2010-1-24 22:44:41

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 406, 102, 192, 124)
$Progress1 = GUICtrlCreateProgress(24, 48, 361, 20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$n=0
$t = Random(5, 20, 1)
AdlibRegister("_eee", 200)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd

Func _eee()
        If $n = $t Then
                GUICtrlSetData($Progress1, 0)
                $t = Random(5, 20, 1)
                $n = 0
        Return       
        EndIf
        $n += 1
        GUICtrlSetData($Progress1, Int(100 / $t * $n))
EndFunc   ;==>_eee
页: [1]
查看完整版本: 进度条循环运行