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

[AU3基础] [已解决]复选框的速度问题?

[复制链接]
发表于 2011-4-22 18:26:55 | 显示全部楼层 |阅读模式
本帖最后由 newuser 于 2011-4-22 18:32 编辑

全选后再全取消,速度怎么不快啊?
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=d:\zgk_2010\artical\software\form1.kxf
Global  $Title="Windows系统管理工具"
If WinExists($Title) Then Exit
AutoItWinSetTitle($Title)
Dim  $Checkbox[18]
$Form1_1 = GUICreate("Form1", 444, 409, 278, 153)
$Tab1 = GUICtrlCreateTab(0, 40, 441, 353)
$TabSheet1 = GUICtrlCreateTabItem("清理相关")
$Group1 = GUICtrlCreateGroup("清理垃圾", 8, 88, 425, 97)
$Checkbox[1] = GUICtrlCreateCheckbox("系统临时文件夹", 16, 112, 105, 17)
$Checkbox[2]= GUICtrlCreateCheckbox("用户临时文件夹", 128, 112, 105, 17)
$Checkbox[3] = GUICtrlCreateCheckbox("系统更新补丁后留下的文件", 248, 112, 169, 17)
$Checkbox[4] = GUICtrlCreateCheckbox("日志文件", 16, 136, 97, 17)
$Checkbox[5] = GUICtrlCreateCheckbox("清空回收站", 128, 136, 105, 17)
$Checkbox[6] = GUICtrlCreateCheckbox("Windows预读取文件", 248, 136, 145, 17)
$Checkbox[7] = GUICtrlCreateCheckbox("DllCache文件夹", 16, 160, 97, 17)
$Checkbox[8] = GUICtrlCreateCheckbox("缩略图缓存文件", 128, 160, 105, 17)
$Checkbox[9] = GUICtrlCreateCheckbox("清除.tmp等类型文件", 248, 160, 137, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("清理系统痕迹", 8, 192, 201, 97)
$Checkbox[10] = GUICtrlCreateCheckbox("运行记录", 16, 216, 129, 17)
$Checkbox[11] = GUICtrlCreateCheckbox("最近打开文档", 16, 240, 97, 17)
$Checkbox[12] = GUICtrlCreateCheckbox("Windows搜索记录", 16, 264, 137, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("全选", 16, 304, 81, 25)
$Button2 = GUICtrlCreateButton("全消", 120, 304, 81, 25)
$Button3 = GUICtrlCreateButton("执行清理", 344, 304, 81, 25)
$Group3 = GUICtrlCreateGroup("清理上网痕迹", 224, 192, 209, 97)
$Checkbox[13] = GUICtrlCreateCheckbox("IE缓存", 232, 216, 81, 17)
$Checkbox[14] = GUICtrlCreateCheckbox("IE历史", 320, 216, 97, 17)
$Checkbox[15] = GUICtrlCreateCheckbox("IE Cookies", 232, 248, 81, 17)
;$Checkbox[16] = GUICtrlCreateCheckbox("网络电影缓存", 340, 248, 97, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label1 = GUICtrlCreateLabel("提示:", 16, 344, 31, 17)
$Label2 = GUICtrlCreateLabel("具体提示内容", 48, 344, 76, 17)
$TabSheet2 = GUICtrlCreateTabItem("故障修复")
$TabSheet3 = GUICtrlCreateTabItem("软件安装")
$TabSheet4 = GUICtrlCreateTabItem("安全播报")
$TabSheet5 = GUICtrlCreateTabItem("关机")
$TabSheet6 = GUICtrlCreateTabItem("TabSheet6")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

;判断清理前各磁盘分区的空闲空间
Local  $Disk=DriveGetDrive("Fixed");获得硬盘所有分区
Local  $Free=0,$Total=0
If Not @error Then
        For $i=1 To $Disk[0];遍历每个分区的自由空间
                $Free=DriveSpaceFree($Disk[$i]&"")
                $Total=$Total+$Free
        Next
EndIf

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case $Button1
                        For $i=1 To 16
                                GUICtrlSetState($Checkbox[$i],$GUI_CHECKED)
                        Next
                Case $Button2
                        For $i=1 To 16
                                GUICtrlSetState($Checkbox[$i],$GUI_UNCHECKED)
                                Sleep(3000)
                        Next
        EndSwitch
WEnd
发表于 2011-4-22 19:51:40 | 显示全部楼层
回复 1# newuser

呵呵,Sleep(3000)
发表于 2011-4-23 08:40:44 | 显示全部楼层
呵呵,楼主,为什么要用Sleep(3000)这个呢,这个是等待.取消还要等待?当然速度问题了.
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-10-2 08:27 , Processed in 0.113219 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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