控制问题
#NoTrayIconOpt("RunErrorsFatal", 0);RUN出错不提示
#include <GUIConstants.au3>
$Form1 = GUICreate("驱动选择安装(先科专用)", 406, 264, 299, 256)
$Group2 = GUICtrlCreateGroup("选择安装驱动", 8, 8, 137, 249)
$Checkbox1 = GUICtrlCreateCheckbox("主板驱动", 24, 48, 113, 17)
$Checkbox2 = GUICtrlCreateCheckbox("显卡驱动", 24, 88, 113, 17)
$Checkbox3 = GUICtrlCreateCheckbox("声卡驱动", 24, 128, 113, 17)
$Checkbox4 = GUICtrlCreateCheckbox("网卡驱动", 24, 168, 113, 17)
$Checkbox5 = GUICtrlCreateCheckbox("视频驱动", 24, 208, 113, 17)
;
$Button1 = GUICtrlCreateButton("全选", 152, 232, 75, 25, 0)
$Button2 = GUICtrlCreateButton("不安装", 240, 232, 75, 25, 0)
$Button3 = GUICtrlCreateButton("安装", 325, 232, 75, 25, 0)
$Pic1 = GUICtrlCreatePic("1.bmp", 153, 14, 247, 210)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
For $i = 1 To 5
GUICtrlSetState(Eval("Checkbox"&$i),$GUI_CHECKED)
Next
这个是全选的代码?
谁给我反选跟, 取消选择的代码
[ 本帖最后由 网络凯子 于 2008-8-4 14:47 编辑 ] 程序可以实现全选的功能,反选和取消选择见如下代码:
Case $Button2 '反选代码
For $i = 1 To 5
If GUICtrlRead(Eval("Checkbox"&$i))=1 Then
GUICtrlSetState(Eval("Checkbox"&$i),$GUI_UNCHECKED)
Else
GUICtrlSetState(Eval("Checkbox"&$i),$GUI_CHECKED)
EndIf
Next
Case $Button3 '取消选择代码
For $i = 1 To 5
GUICtrlSetState(Eval("Checkbox"&$i),$GUI_UNCHECKED)
Next 谢谢
:face (29):
页:
[1]