本帖最后由 heroxianf 于 2018-3-21 16:22 编辑
回复 12# qsy666888
注意放置的先后顺序
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
fxk()
Opt("GUIOnEventMode", 1) ;事件模式开启
Global $Form1, $text, $Button1, $Button2, $Checkbox1, $Checkbox2, $Checkbox3, $Checkbox4, $Checkbox5, $Checkbox6, $Checkbox7
Func fxk() ;你这个命名法要被老大说的
$Form1 = GUICreate("Form1", 200, 178, -1, -1)
$Group1 = GUICtrlCreateGroup("", 5, 0, 189, 148)
$Checkbox1 = GUICtrlCreateCheckbox("全选", 16, 8, 97, 17)
GUICtrlSetOnEvent(-1, "Quding") ;-------------------------------------有反应这里要加东西的
$Checkbox2 = GUICtrlCreateCheckbox("居住", 16, 28, 97, 17)
$Checkbox3 = GUICtrlCreateCheckbox("商业", 16, 48, 97, 17)
$Checkbox4 = GUICtrlCreateCheckbox("公共", 16, 68, 97, 17)
$Checkbox5 = GUICtrlCreateCheckbox("交通", 16, 88, 97, 17)
$Checkbox6 = GUICtrlCreateCheckbox("工业", 16, 108, 97, 17)
$Checkbox7 = GUICtrlCreateCheckbox("其它", 16, 128, 97, 17)
$Button1 = GUICtrlCreateButton("确 定", 54, 150, 60, 23)
GUICtrlSetOnEvent(-1, "Quding")
$Button2 = GUICtrlCreateButton("退 出", 126, 150, 60, 23)
GUICtrlSetOnEvent(-1, "Quding")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
EndFunc ;==>fxk
While 1
Sleep(100)
WEnd
Func Quding()
Local $nMsg
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Button2
Exit
Case $Checkbox1
If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) Then
GUICtrlSetState($Checkbox2, $gui_checked)
GUICtrlSetState($Checkbox3, $gui_checked)
GUICtrlSetState($Checkbox4, $gui_checked)
GUICtrlSetState($Checkbox5, $gui_checked)
GUICtrlSetState($Checkbox6, $gui_checked)
GUICtrlSetState($Checkbox7, $gui_checked)
$text = ' 居住 商业 公共 交通 工业 其它'
MsgBox(0, 0, $text)
Else
GUICtrlSetState($Checkbox2, $gui_unchecked)
GUICtrlSetState($Checkbox3, $gui_unchecked)
GUICtrlSetState($Checkbox4, $gui_unchecked)
GUICtrlSetState($Checkbox5, $gui_unchecked)
GUICtrlSetState($Checkbox6, $gui_unchecked)
GUICtrlSetState($Checkbox7, $gui_unchecked)
$text = ''
MsgBox(0, 0, $text)
EndIf
EndSwitch
EndFunc ;==>Quding
|