本帖最后由 kk_lee69 于 2018-3-21 15:51 编辑
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Dim $text,$Button2,$Checkbox1,$Checkbox2,$Checkbox3,$Checkbox4,$Checkbox5,$Checkbox6,$Checkbox7,$Button1
Opt("GUIOnEventMode", 1)
fxk()
While 1
SLEEP(10)
WEnd
Func fxk()
Global $Form1 = GUICreate("Form1", 200, 178, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP,$WS_SIZEBOX))
;GUISetBkColor(0xF4F7FC)
Global $Group1 = GUICtrlCreateGroup("", 5, 0, 189, 148)
Global $Checkbox1 = GUICtrlCreateCheckbox("全?", 16, 8, 97, 17)
Global $Checkbox2 = GUICtrlCreateCheckbox("居住", 16, 28, 97, 17)
Global $Checkbox3 = GUICtrlCreateCheckbox("商?", 16, 48, 97, 17)
Global $Checkbox4 = GUICtrlCreateCheckbox("公共", 16, 68, 97, 17)
Global $Checkbox5 = GUICtrlCreateCheckbox("交通", 16, 88, 97, 17)
Global $Checkbox6 = GUICtrlCreateCheckbox("工?", 16, 108, 97, 17)
Global $Checkbox7 = GUICtrlCreateCheckbox("其它", 16, 128, 97, 17)
Global $Button1 = GUICtrlCreateButton("确 定", 54, 150, 60, 23)
GUICtrlSetOnEvent(-1, "Quding")
Global $Button2 = GUICtrlCreateButton("退 出", 126, 150, 60, 23)
GUICtrlSetOnEvent(-1, "Form1Close")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
EndFunc
Func Quding()
Switch $XXXX
Case $Button2
Exit
;Case $GUI_EVENT_PRIMARYDOWN
; _SendMessage($Form1, $WM_SYSCOMMAND, $SC_MOVE + $HTCAPTION, 0)
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 = ' 居住 商? 公共 交通 工? 其它'
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 = ''
EndIf
Case $Checkbox2
If BitAND(GUICtrlRead($Checkbox2), $GUI_CHECKED) Then
$text0 = '居住'
$text = $text&' '&$text0
Else
$text = StringReplace($text, " 居住", "")
EndIf
Case $Checkbox3
If BitAND(GUICtrlRead($Checkbox3), $GUI_CHECKED) Then
$text0 = '商?'
$text = $text&' '&$text0
Else
$text = StringReplace($text, " 商?", "")
EndIf
Case $Checkbox4
If BitAND(GUICtrlRead($Checkbox4), $GUI_CHECKED) Then
$text0 = '公共'
$text = $text&' '&$text0
Else
$text = StringReplace($text, " 公共", "")
EndIf
Case $Checkbox5
If BitAND(GUICtrlRead($Checkbox5), $GUI_CHECKED) Then
$text0 = '交通'
$text = $text&' '&$text0
Else
$text = StringReplace($text, " 交通", "")
EndIf
Case $Checkbox6
If BitAND(GUICtrlRead($Checkbox6), $GUI_CHECKED) Then
$text0 = '工?'
$text = $text&' '&$text0
Else
$text = StringReplace($text, " 工?", "")
EndIf
Case $Checkbox7
If BitAND(GUICtrlRead($Checkbox7), $GUI_CHECKED) Then
$text0 = '其它'
$text = $text&' '&$text0
Else
$text = StringReplace($text, " 其它", "")
EndIf
Case $Button1
MsgBox(0,'',$text)
EndSwitch
EndFunc
Func Form1Close()
Exit
EndFunc
|