Code : Tout sélectionner
#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
$parent1 = GUICreate("Form1", 265, 122, 522, 265)
$Button1 = GUICtrlCreateButton("1", 8, 8, 121, 105)
GUICtrlSetOnEvent(-1, "OnePressed")
$Button2 = GUICtrlCreateButton("2", 136, 8, 121, 105)
GUICtrlSetOnEvent(-1, "TwoPressed")
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetState(@SW_SHOW)
$parent2 = GUICreate("Form1", 265, 122, 522, 265)
$Label1 = GUICtrlCreateLabel("1", 120, 32, 16, 42)
GUICtrlSetFont(-1, 24, 400, 0)
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetState(@SW_HIDE)
$parent3 = GUICreate("Parent3", 265, 122, 522, 265)
$Label2 = GUICtrlCreateLabel("2", 120, 32, 16, 42)
GUICtrlSetFont(-1, 24, 400, 0)
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetState(@SW_HIDE)
While 1
Sleep(10)
WEnd
Func OnePressed()
GUISetState(@SW_SHOW, $parent2)
EndFunc ;==>OnePressed
Func TwoPressed()
GUISetState(@SW_SHOW, $parent3)
EndFunc ;==>TwoPressed
Func SpecialEvents()
Select
Case @GUI_CtrlId = $GUI_EVENT_CLOSE
If @GUI_WinHandle = $parent1 Then Exit
If @GUI_WinHandle = $parent2 Then GUIDelete($parent2)
If @GUI_WinHandle = $parent3 Then GUIDelete($parent3)
EndSelect
EndFunc ;==>SpecialEvents