RandomGuest Posted September 7, 2007 Share Posted September 7, 2007 How can I make so when I push a button the script will open a window, and now the script randomly chooses from 100 different texts, and shows the text in a new window. And I got this window, when I push the Options button a new window opens and then I push another button on the option winow to open a new window. Now when I push the exit button on the newest window the window closes down, but when I push the exit button on the Options window nothing happens, does it have anything to with ExitLoop? Thanks =)) ( I have checked the help files but I am noob so I may need some help out of you guys ) Link to comment Share on other sites More sharing options...
Valuater Posted September 7, 2007 Share Posted September 7, 2007 show your code to get the best help 8) Link to comment Share on other sites More sharing options...
RandomGuest Posted September 7, 2007 Author Share Posted September 7, 2007 show your code to get the best help8)I cutted some things out, but it should be cool anyway, well heres the script:#include <GUIConstants.au3>$hGUI = GUICreate ("Test", 900, 700,)Opt("GUICoordMode",5)$button_3 = GUICtrlCreateButton ("Options", 165, 30, 60)$button22 = GUICtrlCreateButton("Exit",285,495,325,100)GUISetState ()While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $button_3 make2() Case $button22 Exit EndSwitchWendFunc Make2() GUICreate("Window 2", 600, 550,) $button21 = GUICtrlCreateButton("Exit",135,420,325,100) $button_4 = GUICtrlCreateButton ("Window 3", 105, 30, 60) GUISetState() While 1 $msg2 = GUIGetMsg() Switch $msg2 Case $GUI_EVENT_CLOSE ExitLoop Case $button_4 make3() Case $button21ExitLoop EndSwitch WEnd GUIDelete("Options")EndFuncFunc Make3() GUICreate("Window 3", 600, 550,) $button20 = GUICtrlCreateButton("Exit",135,420,325,100) GUISetState() While 1 $msg2 = GUIGetMsg() Switch $msg2 Case $GUI_EVENT_CLOSE ExitLoop Case $button20ExitLoop EndSwitch WEnd GUIDelete("Options")EndFunc Link to comment Share on other sites More sharing options...
Paulie Posted September 8, 2007 Share Posted September 8, 2007 expandcollapse popup#include <GUIConstants.au3> Opt("GUICoordMode", 5) $GUI = GUICreate("Test", 900, 700) $button_3 = GUICtrlCreateButton("Options", 165, 30, 60) $button22 = GUICtrlCreateButton("Exit", 285, 495, 325, 100) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $button_3 Make2() Case $button22 Exit EndSwitch WEnd Func Make2() $GUI2=GUICreate("Window 2", 600, 550) $button21 = GUICtrlCreateButton("Exit", 135, 420, 325, 100) $button_4 = GUICtrlCreateButton("Window 3", 105, 30, 60) GUISetState() While 1 $msg2 = GUIGetMsg() Switch $msg2 Case $GUI_EVENT_CLOSE ExitLoop Case $button_4 Make3() Case $button21 ExitLoop EndSwitch WEnd GUIDelete($GUI2) EndFunc ;==>Make2 Func Make3() $GUI3=GUICreate("Window 3", 600, 550) $button20 = GUICtrlCreateButton("Exit", 135, 420, 325, 100) GUISetState() While 1 $msg2 = GUIGetMsg() Switch $msg2 Case $GUI_EVENT_CLOSE ExitLoop Case $button20 ExitLoop EndSwitch WEnd GUIDelete($GUI3) EndFunc ;==>Make3 Seems to work how I expected it to... Main problem was you GUIDeletes. Link to comment Share on other sites More sharing options...
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