MLJman Posted May 3, 2006 Share Posted May 3, 2006 Below is a small section of the first script I have attempted and I am geeting on fine, but how do I close the first window when the second one pops up? It stays there until the rest of the code completes and exits. Help would be much appreciated. #include <GUIConstants.au3> GUICreate("Choice",200,100) $contextmenu = GUICtrlCreateContextMenu () GUICtrlCreateLabel ("Is this a Single or an Album?", 10, 20, 200, 30) $SingleButton = GUICtrlCreateButton("Single",7,60,100,20) $AlbumButton2 = GUICtrlCreateButton("Album",110,60,80,20) GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $SingleButton $Choice = "Single" ExitLoop Case $msg = $AlbumButton2 $Choice = "Album" ExitLoop Case $msg = $GUI_EVENT_CLOSE ; MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...") Exit EndSelect Wend ; More Code MsgBox(0, "AutoIt", "OK. Lets Go!") ; More Code Exit Link to comment Share on other sites More sharing options...
Valuater Posted May 3, 2006 Share Posted May 3, 2006 maybe expandcollapse popup#include <GUIConstants.au3> $Choice = GUICreate("Choice", 200, 100) $contextmenu = GUICtrlCreateContextMenu() GUICtrlCreateLabel("Is this a Single or an Album?", 10, 20, 200, 30) $SingleButton = GUICtrlCreateButton("Single", 7, 60, 100, 20) $AlbumButton2 = GUICtrlCreateButton("Album", 110, 60, 80, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $SingleButton $Choice = "Single" GUIDelete($Choice) ExitLoop Case $msg = $AlbumButton2 $Choice = "Album" GUIDelete($Choice) ExitLoop Case $msg = $GUI_EVENT_CLOSE MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...", 1) Exit EndSelect WEnd ; More Code MsgBox(0, "AutoIt", "OK. Lets Go!", 2) ; More Code Exit 8) Link to comment Share on other sites More sharing options...
MLJman Posted May 3, 2006 Author Share Posted May 3, 2006 maybe expandcollapse popup#include <GUIConstants.au3> $Choice = GUICreate("Choice", 200, 100) $contextmenu = GUICtrlCreateContextMenu() GUICtrlCreateLabel("Is this a Single or an Album?", 10, 20, 200, 30) $SingleButton = GUICtrlCreateButton("Single", 7, 60, 100, 20) $AlbumButton2 = GUICtrlCreateButton("Album", 110, 60, 80, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $SingleButton $Choice = "Single" GUIDelete($Choice) ExitLoop Case $msg = $AlbumButton2 $Choice = "Album" GUIDelete($Choice) ExitLoop Case $msg = $GUI_EVENT_CLOSE MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...", 1) Exit EndSelect WEnd ; More Code MsgBox(0, "AutoIt", "OK. Lets Go!", 2) ; More Code Exit 8)Thanks a lot Valuater, just what I wanted - really appreciate your quick response. I think this is a great scripting program 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