#include <GUIConstants.au3>
$parent1 = GUICreate("Parent1")
$showp2 = GUICtrlCreateButton("显示2", 10, 10)
$parent2 = GUICreate("Parent2", 200, 100)
$hidep2 = GUICtrlCreateButton("隐藏2", 10, 10)
GUISwitch($parent1)
GUISetState()
While 1
$msg = GUIGetMsg(1)
Select
Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $parent1
Exit
Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $parent2
GUISetState(@SW_HIDE, $parent2)
GUISetState(@SW_ENABLE,$parent1)
WinActivate("Parent1")
Case $msg[0] = $showp2
GUISetState(@SW_SHOW, $parent2)
GUISetState(@SW_DISABLE,$parent1)
Case $msg[0] = $hidep2
GUISetState(@SW_HIDE, $parent2)
GUISetState(@SW_ENABLE,$parent1)
WinActivate("Parent1")
EndSelect
WEnd
|