找回密码
 加入
搜索
查看: 2163|回复: 1

请问怎么让进度条动起来

[复制链接]
发表于 2008-8-1 00:07:38 | 显示全部楼层 |阅读模式
请问怎么让下面这段代码中的进度条动起来,并且进度条走的时候不影响其他按钮的操作。进度条走完后执行点击第一个按钮操作

#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Res_Comment=软件自动安装分区选择工具
#AutoIt3Wrapper_Res_Fileversion=V1.0
#AutoIt3Wrapper_Res_LegalCopyright=浪心剑客
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("通用软件自动安装分区选择工具", 498, 321, 236, 235)
$Button1 = GUICtrlCreateButton("更改软件安装路径为 C 盘", 208, 16, 267, 41, 0)
GUICtrlSetFont(-1, 14, 800, 0, "楷体_GB2312")
GUICtrlSetCursor(-1, 0)
$Button2 = GUICtrlCreateButton("更改软件安装路径为 D 盘", 208, 75, 267, 41, 0)
GUICtrlSetFont(-1, 14, 800, 0, "楷体_GB2312")
GUICtrlSetCursor(-1, 0)
$Button3 = GUICtrlCreateButton("更改软件安装路径为 E 盘", 208, 133, 267, 41, 0)
GUICtrlSetFont(-1, 14, 800, 0, "楷体_GB2312")
GUICtrlSetCursor(-1, 0)
$Button4 = GUICtrlCreateButton("更改软件安装路径为 F 盘", 208, 192, 267, 41, 0)
GUICtrlSetFont(-1, 14, 800, 0, "楷体_GB2312")
GUICtrlSetCursor(-1, 0)
$Pic1 = GUICtrlCreatePic("logo4.BMP", 0, 0, 185, 320, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Label1 = GUICtrlCreateLabel("10秒后自动安装软件到 C 盘", 250, 255, 160, 17)
$Progress1 = GUICtrlCreateProgress(224, 272, 238, 10)
GUICtrlSetColor(-1, 32250)
GUICtrlSetLimit(-1, 10, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Run("SoftManager.exe")
                        Exit
                Case $Button1
                Case $Button2
                Case $Button3
                Case $Button4
        EndSwitch
WEnd


[ 本帖最后由 tzg_lxjk 于 2008-8-1 00:39 编辑 ]
 楼主| 发表于 2008-8-1 00:39:16 | 显示全部楼层
哎。。自己找到答案了。。
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Res_Comment=软件自动安装分区选择工具
#AutoIt3Wrapper_Res_Fileversion=V1.0
#AutoIt3Wrapper_Res_LegalCopyright=浪心剑客
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$i = 0
$Form1 = GUICreate("通用软件自动安装分区选择工具", 498, 321, 236, 235)
$Button1 = GUICtrlCreateButton("更改软件安装路径为 C 盘", 208, 16, 267, 41, 0)
GUICtrlSetFont(-1, 14, 800, 0, "楷体_GB2312")
GUICtrlSetCursor(-1, 0)
$Button2 = GUICtrlCreateButton("更改软件安装路径为 D 盘", 208, 75, 267, 41, 0)
GUICtrlSetFont(-1, 14, 800, 0, "楷体_GB2312")
GUICtrlSetCursor(-1, 0)
$Button3 = GUICtrlCreateButton("更改软件安装路径为 E 盘", 208, 133, 267, 41, 0)
GUICtrlSetFont(-1, 14, 800, 0, "楷体_GB2312")
GUICtrlSetCursor(-1, 0)
$Button4 = GUICtrlCreateButton("更改软件安装路径为 F 盘", 208, 192, 267, 41, 0)
GUICtrlSetFont(-1, 14, 800, 0, "楷体_GB2312")
GUICtrlSetCursor(-1, 0)
$Pic1 = GUICtrlCreatePic("logo4.BMP", 0, 0, 185, 320, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Label1 = GUICtrlCreateLabel("10秒后自动安装软件到 C 盘", 250, 255, 160, 17)
$Progress1 = GUICtrlCreateProgress(224, 272, 238, 10)
GUICtrlSetColor(-1, 32250)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Run("SoftManager.exe")
                        Exit
                Case Else
                        $i = $i + 10
                        GUICtrlSetData($Progress1, $i)
                        Sleep(1000)
                        If $i = 100 Then
                                Run("SoftManager.exe")
                                Exit
                        EndIf
        EndSwitch
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Run("SoftManager.exe")
                        Exit
                Case $Button1
                Case $Button2
                Case $Button3
                Case $Button4
        EndSwitch
WEnd
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-19 09:29 , Processed in 0.072851 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表