Rental Posted October 12, 2008 Posted October 12, 2008 This has probably been asked a million times but i cant find any answers that help me. Here is what i have but it closes all the windows when i only want 1 to: #include <GUIConstantsEx.au3> GUICreate("") GUISetState(@sw_show) $button = GUICtrlCreateButton("New Window",150,150) Do $msg = GUIGetMsg() If $msg = $button Then GUICreate("Gui 2",200,200) GUISetState(@sw_show) GUISetBkColor(0x000000) EndIf Until $msg = $GUI_EVENT_CLOSE
FaT3oYCG Posted October 12, 2008 Posted October 12, 2008 use winclose() on the gui you want to close, if you call your second gui Gui 2 then do winclose("Gui 2") Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right.
Dampe Posted October 12, 2008 Posted October 12, 2008 (edited) #include <GUIConstantsEx.au3> Local $GUI, $GUI2 $GUI = GUICreate("") GUISetState(@sw_show) $button = GUICtrlCreateButton("New Window",150,150) While 1 $msg = GUIGetMsg() If $msg = $button Then $GUI2 = GUICreate("Gui 2",200,200) GUISetState(@sw_show) GUISetBkColor(0x000000) EndIf If $msg = $GUI_EVENT_CLOSE Then If $Gui2 Then GUIDelete($Gui2) $GUI2 = "" Else Exit 0 EndIf Endif Wend Edited October 12, 2008 by Dampe
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