找回密码
 加入
搜索
查看: 1411|回复: 11

求解这个进度条问题

[复制链接]
发表于 2009-7-29 01:14:04 | 显示全部楼层 |阅读模式
本帖最后由 sunny617 于 2009-7-29 19:00 编辑

http://www.autoitx.com/forum.php ... C8%CC%F5&page=1

这是别人的贴子。。。 我提了上来。。发现当我移动GUI时。。进度条就会停止运行?
求解
发表于 2009-7-29 01:21:14 | 显示全部楼层
Case $nMsg = $GUI_EVENT_PRIMARYDOWN
    AdlibDisable()

鼠标主按钮按下就停止了
 楼主| 发表于 2009-7-29 09:15:50 | 显示全部楼层
$GUI_EVENT_PRIMARYDOWN
是什么..没查到?
发表于 2009-7-29 12:06:32 | 显示全部楼层
$GUI_EVENT_PRIMARYDOWN
鼠标左键按下产生的事件,拖窗口肯定左键按下了。
 楼主| 发表于 2009-7-29 15:28:46 | 显示全部楼层
但是如果移动窗口...肯定会有鼠标事件的

发表于 2009-7-29 15:48:47 | 显示全部楼层
可以改写成在窗口用户区点击就停呀。
发表于 2009-7-29 15:54:36 | 显示全部楼层
如果需要,最好是改成点击某个控件再停止
发表于 2009-7-29 16:04:48 | 显示全部楼层
#Region ;**** 参数创建于 AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Change.ico
#EndRegion;**** 参数创建于 ACNWrapper_GUI ****
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****

#include <GUIConstantsEx.au3>

$Form = GUICreate("倒计时&进度条示例", 280, 230, 195, 125)
GUISetState(@SW_SHOW)

;倒计时进度条
Global $time = 8
#Region ### START Koda GUI section ### Form=
$Label5 = GUICtrlCreateLabel($time & "秒后自动放弃操作!", 30, 168, 200, 25)
GUICtrlSetColor($Label5, 0x8A2BE2)
GUICtrlSetFont($Label5, 10)
$Progress1 = GUICtrlCreateProgress(20, 195, 230, 10)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister("_timer", 1000)


Func _timer()
        $time -= 1
        GUICtrlSetData($Label5, $time & "秒后自动放弃操作!!")
        GUICtrlSetData($Progress1, (10 - $time) / 0.1)
        If $time <= 0 Then Exit
EndFunc   ;==>_timer


While 1
        $nMsg = GUIGetMsg()
        Select
                Case $nMsg = $GUI_EVENT_CLOSE
                        DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form, "int", 500, "long", 0x00090000)
                        Exit
                Case $nMsg = $GUI_EVENT_PRIMARYDOWN
                        $XY=GUIGetCursorInfo()
                        If $xy[0]>0 And $XY[0]<280 And $XY[1]>0 And $XY[1]<230 Then
                                AdlibUnRegister("_timer")
                            GUICtrlSetState($Progress1, $GUI_DISABLE)
                        EndIf
        EndSelect
WEnd

评分

参与人数 1金钱 +20 贡献 +19 收起 理由
kn007 + 20 + 19 没试下,不过感谢你对论坛的支持;希望继续 ...

查看全部评分

 楼主| 发表于 2009-7-29 18:59:36 | 显示全部楼层
$GUI_EVENT_PRIMARYDOWN

嗯,,学习了.....
发表于 2009-7-29 21:59:10 | 显示全部楼层
谢谢,8楼的代码正需要
发表于 2009-8-7 00:27:12 | 显示全部楼层
谢谢,8楼的代码正需要
发表于 2009-8-7 10:05:57 | 显示全部楼层
看到你们的交流,真的是比较惭愧。哎!努力学习!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-3 00:44 , Processed in 0.082546 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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