|
#include-once
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
Dim $ary[3]
Opt("GUIOnEventMode", 1)
$GUI = GUICreate("窗口管理器", 300, 150)
GUISetOnEvent($GUI_EVENT_MINIMIZE, "mian")
GUISetOnEvent($GUI_EVENT_RESTORE, "mian")
$checkCN1 = GUICtrlCreateCheckbox ("KCBP窗口", -1, 20, 120, 20)
$checkCN2 = GUICtrlCreateCheckbox ("Tomcat窗口", -1, 40, 120, 20)
$checkCN3 = GUICtrlCreateCheckbox ("Kcxpmanager窗口", -1, 60, 120, 20)
$GUIButton1 = GUICtrlCreateButton ("显示", -1, 100, 50, 20)
$GUIButton2 = GUICtrlCreateButton ( "隐藏", 100,100,50, 20)
$GUIButton3 = GUICtrlCreateButton ( "退出", 250,130,50, 20)
GUICtrlSetOnEvent($GUIButton1, "Button")
GUICtrlSetOnEvent($GUIButton2, "Button")
GUICtrlSetOnEvent($GUIButton3, "Button")
GUISetState(@SW_SHOW)
While 1
Sleep(1000)
WEnd
Func mian()
Select
Case @GUI_CTRLID = $GUI_EVENT_MINIMIZE
Case @GUI_CTRLID = $GUI_EVENT_RESTORE
EndSelect
EndFunc
func Button()
Switch @GUI_CTRLID
Case $GUIButton1
If $ary[0] <> 0 Then
WinSetState ("交易中间件 - KCBP","",@SW_SHOW)
ElseIf $ary[1] <> 0 Then
WinSetState ("Tomcat","",@SW_SHOW)
ElseIf $ary[2] <> 0 Then
WinSetState ("管理器 - [节点名称:Dark] [节点编号:00000001]","",@SW_SHOW)
EndIf
Case $GUIButton2
Select
Case GUICtrlGetState($checkCN1) = $GUI_CHECKED
WinSetState ("交易中间件 - KCBP","",@SW_HIDE)
MsgBox(0,"","$checkCN1")
Case GUICtrlGetState($checkCN2) = $GUI_CHECKED
MsgBox(0,"","$checkCN2")
WinSetState ("交易中间件 - KCBP","",@SW_HIDE)
Case GUICtrlGetState($checkCN3) = $GUI_CHECKED
MsgBox(0,"","$checkCN3")
WinSetState ("KCXP管理器 - [节点名称:Dark] [节点编号:00000001]","",@SW_HIDE)
Case Else
MsgBox(0,"","都没有选中")
ControlDisable ("隐藏","窗口文本",$GUIButton2)
EndSelect
Case $GUIButton3
Exit
EndSwitch
EndFunc
我想实现的效果是:
1.选择其中的1项或3项,单击按钮时,进行隐藏窗口;
2.在没有选择时,置灰按钮;
可现在是,我还没有选择,去单击按钮它会自动选择,复选框。怎么做到我没有选择复选框时,单击按钮时它也不会自动选择复选框。 |
|