Opt('GUIOnEventMode', 1)
$hGuiH = GUICreate('窗口切换', 600, 200)
GUISetOnEvent(-3, '_Exit')
$iBt1 = GUICtrlCreateButton('切换', 100, 100, 150, 25)
GUICtrlSetOnEvent(-1, '_Change')
GUICtrlCreateButton('测试', 100, 130, 150, 25)
GUICtrlSetOnEvent(-1, '_Test')
GUISetState()
$hGuiS = GUICreate('窗口切换', 200, 600)
GUISetOnEvent(-3, '_Exit')
$iBt2 = GUICtrlCreateButton('切换', 50, 400, 120, 25)
GUICtrlSetOnEvent(-1, '_Change')
GUICtrlCreateButton('测试', 50, 430, 120, 25)
GUICtrlSetOnEvent(-1, '_Test')
While 1
Sleep(1000)
WEnd
Func _Change()
Switch @GUI_CtrlId
Case $iBt1
GUISetState(0, $hGuiH)
GUISetState(1, $hGuiS)
Case $iBt2
GUISetState(0, $hGuiS)
GUISetState(1, $hGuiH)
EndSwitch
EndFunc ;==>_Change
Func _Test()
MsgBox(0, '', 'Test')
EndFunc ;==>_Test
Func _Exit()
Exit
EndFunc ;==>_Exit
|