rony2006 Posted May 16, 2016 Posted May 16, 2016 Hello, I have a script which has a GUI. from that gui if I click a button, another gui pops up. When I close the second GUI, also the main gui si closing. How I can prevent this? I tried this: #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiButton.au3> $first_gui = GUICreate("first gui",350,350,-1,-1,-1,-1) $secondGUI = GUICtrlCreateButton("second gui",120,140,100,30,-1,-1) GUISetState(@SW_SHOW,$first_gui) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $secondGUI $secondgui = GUICreate("second gui",194,111,-1,-1,-1,-1) GUISetState(@SW_SHOW,$secondgui) EndSwitch WEnd I tried this: expandcollapse popup#include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiButton.au3> $first_gui = GUICreate("first gui",350,350,-1,-1,-1,-1) $secondGUI = GUICtrlCreateButton("second gui",120,140,100,30,-1,-1) GUISetState(@SW_SHOW,$first_gui) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $secondGUI $secondgui = GUICreate("second gui",194,111,-1,-1,-1,-1) GUISetState(@SW_SHOW,$secondgui) While 2 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUISetState(@SW_HIDE,$secondgui) EndSwitch WEnd EndSwitch WEnd And my second GUI is closing without closing the main gui, BUT the problem is that now if I click the button, no second gui shows up.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now