Jump to content

close many child gui


faustf
 Share

Recommended Posts

hi guys    i have a gui  with   2 child like matrioska  :D parent  (push button )--> 1 child  in  child  (push button ) --->2 child

when i colse  the   last child  ,  is  all ok  the gui   killed , but   the   1 child  or parent  not  possible  close

why??

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Global $pass
gui()
Func gui()
$Form1 = GUICreate("Form1", 623, 449, 192, 114)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
$Button1 = GUICtrlCreateButton("Button1", 272, 128, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
$pass=$Form1
    GUISetOnEvent($GUI_EVENT_CLOSE, Form1Close)
EndFunc

While 1
    Sleep(100)
WEnd

Func Button1Click()
;   GUISetState( @SW_DISABLE   , $Form1)
$Form2 = GUICreate("Form1", 413, 305, 781, 414)

$Button3 = GUICtrlCreateButton("Button1", 320, 208, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click2")
GUISetState(@SW_SHOW)
$pass=$Form2
    GUISetOnEvent($GUI_EVENT_CLOSE, Form1Close)
EndFunc

 Func Button1Click2()
$Form3 = GUICreate("Form1", 413, 305, 781, 414)

$Button4 = GUICtrlCreateButton("Button1", 320, 208, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click2")
GUISetState(@SW_SHOW)

$pass=$Form3
    GUISetOnEvent($GUI_EVENT_CLOSE, Form1Close)
 EndFunc

Func Form1Close()
GUIDelete($pass)
EndFunc
Func Form1Maximize()

EndFunc
Func Form1Minimize()

EndFunc
Func Form1Restore()

EndFunc

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...