BoonPek 0 Posted June 17, 2010 I am working on an almost complete project. I want to have a button that when clicked, opens a new GUI and when that GUI closes, the main GUI is still intact. Here is a part of my code: #include <GuiConstantsEX.au3> $MainGUI = GUICreate("Main GUI", 300, 200, -1, -1) $SetData = GUICtrlCreateButton("Set Data", 10, 10, 280, 180) GUISetState(@SW_SHOW) Do $msg = GUIGetMsg() Switch $msg Case $SetData SETDATA() EndSwitch Until $msg = $GUI_EVENT_CLOSE Func SETDATA() $Data = GUICreate("Set Data", 200, 300, -1, -1) GUISetState(@SW_SHOW) Do $msg1 = GUIGetMsg() Until $msg1 = $GUI_EVENT_CLOSE EndFunc I don't want the Main GUI to close when I close the Set Data GUI. Is there a way to allow this to happen without any modification of the Do-Until loop (The SetData Loop can be modified)? Share this post Link to post Share on other sites
kaotkbliss 146 Posted June 17, 2010 (edited) *edit* Nevermind my previous idea it would not work this seems to be be working though. #include <GuiConstantsEX.au3> $MainGUI = GUICreate("Main GUI", 300, 200, -1, -1) $SetData = GUICtrlCreateButton("Set Data", 10, 10, 280, 180) GUISetState(@SW_SHOW) Do $msg = GUIGetMsg() Switch $msg Case $SetData SETDATA() EndSwitch Until $msg = $GUI_EVENT_CLOSE Func SETDATA() $Data = GUICreate("Set Data", 200, 300, -1, -1) GUISetState(@SW_SHOW) Do $msg1 = GUIGetMsg() Until $msg1 = $GUI_EVENT_CLOSE CLOSEClicked() EndFunc Func CLOSEClicked() GUIDelete() EndFunc I think it is the Do...Until that conflicts with the guigetmsg You could probably even remove the extra func and just add guidelete right after Until $msg1 = $GUI_EVENT_CLOSE *edit* yep, this works too #include <GuiConstantsEX.au3> $MainGUI = GUICreate("Main GUI", 300, 200, -1, -1) $SetData = GUICtrlCreateButton("Set Data", 10, 10, 280, 180) GUISetState(@SW_SHOW) Do $msg = GUIGetMsg() Switch $msg Case $SetData SETDATA() EndSwitch Until $msg = $GUI_EVENT_CLOSE Func SETDATA() $Data = GUICreate("Set Data", 200, 300, -1, -1) GUISetState(@SW_SHOW) Do $msg1 = GUIGetMsg() Until $msg1 = $GUI_EVENT_CLOSE GUIDelete() EndFunc Edited June 17, 2010 by kaotkbliss 010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueekWe're gonna need another Timmy! Share this post Link to post Share on other sites