不大明白你的目的,只能用猜。也不知道合不合你的意。
#include <GUIConstantsEx.au3>
;~ Opt('MustDeclareVars', 1)
Global $Checkbox_Name_1 = "Checkbox1"
Global $Checkbox_Name_2 = "Checkbox2"
Global $Checkbox_Name_3 = "Checkbox3"
Global $Checkbox1, $Checkbox2, $Checkbox3
Global $msg, $Combo, $a
Example()
Func Example()
GUICreate("My GUI combo") ; 创建一个对话框,并居中显示
Local $Checkbox[3],$number
$Combo = GUICtrlCreateCombo("item1", 10, 10) ; 创建一个组合列表框(ComboBox)控件
GUICtrlSetData($Combo, "item2|item3", "item3") ; 在列表框中添加新的项目,并设置一个新的默认值
$Checkbox[0] = GUICtrlCreateCheckbox($Checkbox_Name_1, 112, 232, 97, 17)
$Checkbox[1] = GUICtrlCreateCheckbox($Checkbox_Name_2, 112, 312, 97, 17)
$Checkbox[2] = GUICtrlCreateCheckbox($Checkbox_Name_3, 112, 352, 97, 17)
GUISetState()
$a = GUICtrlRead($Combo)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Combo
$number = StringRegExp(GUICtrlRead(3), '\d', 3)
For $i = 0 To 2
GUICtrlSetState($Checkbox[$i], $GUI_ENABLE)
Next
GUICtrlSetState($Checkbox[$number[0]-1], $GUI_DISABLE)
EndSwitch
WEnd
EndFunc ;==>Example
|