#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 483, 374, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 88, 152, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 88, 184, 97, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 88, 216, 97, 17)
$Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 48, 112, 97, 17)
$gggg = GUICtrlCreateCombo("", 166, 112, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetData($gggg, "全部勾选|勾选部份", "勾选部份")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $gggg
GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
GUICtrlSetState($Checkbox3, $GUI_UNCHECKED)
GUICtrlSetState($Checkbox4, $GUI_UNCHECKED)
If GUICtrlRead($gggg) = "全部勾选" Then
GUICtrlSetState($Checkbox1, $GUI_CHECKED)
GUICtrlSetState($Checkbox2, $GUI_CHECKED)
GUICtrlSetState($Checkbox3, $GUI_CHECKED)
GUICtrlSetState($Checkbox4, $GUI_CHECKED)
EndIf
If GUICtrlRead($gggg) = "勾选部份" Then
GUICtrlSetState($Checkbox1, $GUI_CHECKED)
GUICtrlSetState($Checkbox3, $GUI_CHECKED)
EndIf
EndSwitch
WEnd
小白回答,仅供参考。 |