找回密码
 加入
搜索
查看: 1113|回复: 2

按了控件后进度条不停止!

[复制链接]
发表于 2009-9-29 14:18:53 | 显示全部楼层 |阅读模式
本帖最后由 那片叶子 于 2009-9-29 14:53 编辑
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>

$time=10
$Form1 = GUICreate("测试", 221, 108, 415, 319)
$Checkbox1 = GUICtrlCreateCheckbox("复选1", 16, 24, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("复选2", 120, 24, 97, 17)
$Button1 = GUICtrlCreateButton("按 钮", 64, 56, 75, 22, 0)
$Progress1 = GUICtrlCreateProgress(8, 88, 201, 9)
GUISetState(@SW_SHOW)
AdlibEnable("pro1", 10 * $time)

$wait = 0
Func pro1()
        GUICtrlSetData($Progress1, $wait)
        For $v = 0 To $time Step 1
                If GUICtrlRead($Progress1) = $v * 10 / ($time / 10) Then
                        ;GUICtrlSetData($Labtime," " & $time-$v )
                EndIf
        Next
        $wait = $wait + 1
        If $wait = 101 Then DrvUnComp()
EndFunc

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
按了 按钮和附件 都不能停止进度条,请各位大侠帮我看看!
发表于 2009-9-29 14:42:54 | 显示全部楼层
这样?
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>

$time=10
$Form1 = GUICreate("测试", 221, 108, 415, 319)
$Checkbox1 = GUICtrlCreateCheckbox("复选1", 16, 24, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("复选2", 120, 24, 97, 17)
$Button1 = GUICtrlCreateButton("按 钮", 64, 56, 75, 22, 0)
$Progress1 = GUICtrlCreateProgress(8, 88, 201, 9)
GUISetState(@SW_SHOW)
AdlibEnable("pro1", 10 * $time)

$wait = 0
Func pro1()
        GUICtrlSetData($Progress1, $wait)
        For $v = 0 To $time Step 1
                If GUICtrlRead($Progress1) = $v * 10 / ($time / 10) Then
                        ;GUICtrlSetData($Labtime," " & $time-$v )
                EndIf
        Next
        $wait = $wait + 1
        If $wait = 101 Then DrvUnComp()
EndFunc

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit                                                
                                Case $Button1
                                                AdlibDisable()
        EndSwitch
WEnd

评分

参与人数 1金钱 +10 贡献 +5 收起 理由
afan + 10 + 5

查看全部评分

 楼主| 发表于 2009-9-29 14:53:37 | 显示全部楼层
谢谢了 !!!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-5 15:17 , Processed in 0.071908 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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