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

[GUI管理] 手冊有個example沒看懂。。囧[已解决]

[复制链接]
发表于 2011-8-19 20:44:54 | 显示全部楼层 |阅读模式
本帖最后由 jack2684 于 2011-9-22 08:28 编辑

第28行的-3是什麽意思呢?
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $progressbar1, $progressbar2, $button, $wait, $s, $msg, $m
    
    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; wait 20ms for next progressstep
    $s = 0; progressbar-saveposition
    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
EndFunc   ;==>Example
发表于 2011-8-19 20:56:49 | 显示全部楼层
$GUI_EVENT_CLOSE = -3
发表于 2011-8-19 21:02:43 | 显示全部楼层
Case $msg = $GUI_EVENT_CLOSE
                                MsgBox(0, "", $GUI_EVENT_CLOSE)
                                Exit
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-17 10:36 , Processed in 0.075057 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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