[已解决]复选框的速度问题?
本帖最后由 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
$Form1_1 = GUICreate("Form1", 444, 409, 278, 153)
$Tab1 = GUICtrlCreateTab(0, 40, 441, 353)
$TabSheet1 = GUICtrlCreateTabItem("清理相关")
$Group1 = GUICtrlCreateGroup("清理垃圾", 8, 88, 425, 97)
$Checkbox = GUICtrlCreateCheckbox("系统临时文件夹", 16, 112, 105, 17)
$Checkbox= GUICtrlCreateCheckbox("用户临时文件夹", 128, 112, 105, 17)
$Checkbox = GUICtrlCreateCheckbox("系统更新补丁后留下的文件", 248, 112, 169, 17)
$Checkbox = GUICtrlCreateCheckbox("日志文件", 16, 136, 97, 17)
$Checkbox = GUICtrlCreateCheckbox("清空回收站", 128, 136, 105, 17)
$Checkbox = GUICtrlCreateCheckbox("Windows预读取文件", 248, 136, 145, 17)
$Checkbox = GUICtrlCreateCheckbox("DllCache文件夹", 16, 160, 97, 17)
$Checkbox = GUICtrlCreateCheckbox("缩略图缓存文件", 128, 160, 105, 17)
$Checkbox = GUICtrlCreateCheckbox("清除.tmp等类型文件", 248, 160, 137, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("清理系统痕迹", 8, 192, 201, 97)
$Checkbox = GUICtrlCreateCheckbox("运行记录", 16, 216, 129, 17)
$Checkbox = GUICtrlCreateCheckbox("最近打开文档", 16, 240, 97, 17)
$Checkbox = 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 = GUICtrlCreateCheckbox("IE缓存", 232, 216, 81, 17)
$Checkbox = GUICtrlCreateCheckbox("IE历史", 320, 216, 97, 17)
$Checkbox = GUICtrlCreateCheckbox("IE Cookies", 232, 248, 81, 17)
;$Checkbox = 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;遍历每个分区的自由空间
$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
回复 1# newuser
呵呵,Sleep(3000) 呵呵,楼主,为什么要用Sleep(3000)这个呢,这个是等待.取消还要等待?当然速度问题了.
页:
[1]