进度条问题,大虾们来看看
如何将进度条设置不停的移动,当指定程序运行完成就停止进度条。[ 本帖最后由 hmqtools 于 2009-4-10 02:50 编辑 ] 进度条帮助里的例子已经很清楚了 路过,,,,。。。。。。。。。。。。。。。 这里是帮助里面的例子,楼主可以自己研究下
#include <GUIConstants.au3>
dim $PBS_SMOOTH
GUICreate("我的 GUI 之进度条",220,100, 100,200)
$progressbar1 = GUICtrlCreateProgress (10,10,200,20)
GUICtrlSetColor(-1,32250); 对 Windows XP 主题无效
$progressbar2 = GUICtrlCreateProgress (10,40,200,20,$PBS_SMOOTH)
$button = GUICtrlCreateButton ("开始",75,70,70,20)
GUISetState ()
$wait = 20; 进度条没进一个单位就等20毫秒
$s = 0; 用于保存进度条的滑块位置
do
$msg = GUIGetMsg()
If $msg = $button Then
GUICtrlSetData ($button,"暂停")
For $i = $s To 100
If GUICtrlRead($progressbar1) = 50 Then Msgbox(0,"信息","已完成一半...", 1)
$m = GUIGetMsg ()
If $m = -3 Then ExitLoop
If $m = $button Then
GUICtrlSetData ($button,"继续")
$s = $i;保存当前滑块位置到 $s
ExitLoop
Else
$s=0
GUICtrlSetData ($progressbar1,$i)
GUICtrlSetData ($progressbar2,(100 - $i))
Sleep($wait)
EndIf
Next
if $i >100 then
; $s=0
GUICtrlSetData ($button,"开始")
endif
EndIf
until $msg = $GUI_EVENT_CLOSE
页:
[1]