Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Parent-Child question

$
0
0

Hello, i want to open a Child gui from a parent GUI. When the child is opened, the parent must be disabled. When the child is gone, the parent come back to enabled.

 

This is what i have done:

AutoIt         
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $Parent Parent() Func Parent()     $Parent = GUICreate("Form1", 448, 382, 162, 88)     $Button = GUICtrlCreateButton("Child", 8, 8, 75, 25)     GUISetState(@SW_SHOW)     While 1         $nMsg = GUIGetMsg()         Switch $nMsg             Case $GUI_EVENT_CLOSE                 Exit             Case $Button                 GUISetState(@SW_DISABLE, $Parent)                 Child()         EndSwitch     WEnd EndFunc   ;==>Parent Func Child()     $Child = GUICreate("Form1", 180, 169, -1, -1, Default, Default, $Parent)     GUISetState(@SW_SHOW)     While 1         $nMsg = GUIGetMsg()         Switch $nMsg             Case $GUI_EVENT_CLOSE                 GUISetState(@SW_ENABLE, $Parent)                 GUIDelete($Child)         EndSwitch     WEnd EndFunc   ;==>Child

When i close the child the parent X button don't work anymore, how i can resolve?


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>