大菜鸟救助解决下进度条的问题 (已解决)
大菜鸟救助解决下进度条的问题偶才刚开始学,呵呵!
编自动安装的脚本偶是学会了,可想编个界面来调用却被进度条这里卡住了
哪位大大帮忙解决下
偶是弄不明白进度条怎么才能调用进去,想让它倒数10秒自动执行安装,大大们来帮忙啊
#include <GUIConstants.au3>
GUICreate("自动安装", 401, 221, 193, 125)
GUISetBkColor(0xFFFFFF)
$Group1 = GUICtrlCreateGroup("", 24, 24, 353, 137)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton ("安装", 192, 176, 83, 33, 0)
$Close = GUICtrlCreateButton ("关闭", 304, 176, 75, 33, 0)
GUISetState()
$Progress1 = GUICtrlCreateProgress(24, 184, 142, 17)
While 1
$Msg = GUIGetMsg()
Select
Case $msg = $Button1
Run('setup1.exe')
ExitLoop
Case $msg = $GUI_EVENT_CLOSE or $msg = $Close
ExitLoop
EndSelect
WEnd
[ 本帖最后由 19791111 于 2008-5-20 22:45 编辑 ] 可以 使用 AdlibEnable使进度条走 这个真不好学呀~:face (30):
弄了半天进度条这个弄好了
可是时间到了自动运行程序后却不会自动退出。:face (13):
请教下要加什么代码才能执行退出呢?
#include <GUIConstants.au3>
GUICreate("自动安装", 401, 221, 193, 125)
GUISetBkColor(0xFFFFFF)
$Group1 = GUICtrlCreateGroup("", 24, 24, 353, 137)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton ("安装", 192, 176, 83, 33, 0)
$Close = GUICtrlCreateButton ("关闭", 304, 176, 75, 33, 0)
$Progress1 = GUICtrlCreateProgress(24, 184, 142, 17)
GUICtrlSetColor(-1,32250)
GUISetState()
AdlibEnable("Progress2",100)
Dim $i = 1
While 1
$Msg = GUIGetMsg()
Select
Case $msg = $Button1
Run('setup1.exe')
ExitLoop
Case $msg = $GUI_EVENT_CLOSE or $msg = $Close
ExitLoop
EndSelect
WEnd
Func Progress2()
GUICtrlSetData ($Progress1,($i/50)*100)
$i += 1
If $i = 50 Then Run('setup1.exe')
EndFunc #include <GUIConstants.au3>
GUICreate("自动安装", 401, 221, 193, 125)
GUISetBkColor(0xFFFFFF)
$Group1 = GUICtrlCreateGroup("", 24, 24, 353, 137)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton ("安装", 192, 176, 83, 33, 0)
$Close = GUICtrlCreateButton ("关闭", 304, 176, 75, 33, 0)
$Progress1 = GUICtrlCreateProgress(24, 184, 142, 17)
GUICtrlSetColor(-1,32250)
GUISetState()
AdlibEnable("Progress2",100)
Dim $i = 1
While 1
$Msg = GUIGetMsg()
Select
Case $msg = $Button1
Run('notepad.exe')
ExitLoop
Case $msg = $GUI_EVENT_CLOSE or $msg = $Close
ExitLoop
EndSelect
WEnd
Func Progress2()
GUICtrlSetData ($Progress1,($i/50)*100)
$i += 1
If $i = 50 Then
Run('notepad.exe')
Exit ;=====退出======
EndIf
EndFunc
[ 本帖最后由 夜苦寒 于 2008-5-20 22:52 编辑 ] 偶真是晕菜了~呵呵~
非常感谢楼上的大哥
:face (3): 这是不是用AdlibEnable来每隔0.5秒调用一次Progress2!而Progress2就使$i自加1!从而使进度条自动倒数? 感谢回答问题的师傅们 error: AdlibEnable(): 未定义的函数.
页:
[1]