将就用一下吧
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ColorConstants.au3>
#include <GUIConstantsEx.au3>
$gui=GUICreate("GUI", 294, 88, 192, 124)
$idProgressBar1 =_Progress_Create(8, 24, 278, 24)
$idProgressBar2 =_Progress_Create(8, 49, 278, 24)
GUISetState(@SW_SHOW)
_progress_SetDate($gui,$idProgressBar1,5)
for $i=1 To 10
_progress_SetDate($gui,$idProgressBar2,$i)
sleep(500)
Next
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _Progress_Create($left,$top,$width,$height)
Local $aProgress[3]
$aProgress[0] =$width
$aProgress[2] = GUICtrlCreateLabel("", $left,$top,0,$height, $SS_CENTER)
GUICtrlSetBkColor(-1, 0x00FF00)
$aProgress[1] = GUICtrlCreateLabel("", $left,$top,$width,$height, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetColor(-1,0x000000)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
Return $aProgress
EndFunc
Func _progress_SetDate($Form,$progress,$data)
$v=$data/10*$progress[0]
ControlMove($Form,"",$Progress[2],Default,Default,$v)
GUICtrlSetData($Progress[1],$data*10&"%")
If $data>5 Then
GUICtrlSetBkColor($Progress[2],0xff0000)
EndIf
EndFunc
|