Jump to content
Sign in to follow this  
PPowerHouseK

Closing A Second GUI

Recommended Posts

Hello all,

I am trying to create a sort of pop out menu for my script. It will just be another gui that opens from the main one, with the push of a button. But for some reason I can't seen yo get the newly opened Gui to close. If I click the X nothing happens and using Exitloop closes both the main and the new gui. Here is what I have

#include <GUIConstants.au3>

GUICreate("Window")
GUISetState ()
$button = GUICtrlCreateButton("click me", 50 , 50)

While 1
    Switch GUIGetMsg()

            Case $button
                GUICreate("Extra Window",300,300)
                GUISetState ()
                $close = GUICtrlCreateButton("Close",50, 50)
                While 1
                Switch GUIGetMsg()
                    Case $close
                        ExitLoop
                EndSwitch
                WEnd

                Exit


    EndSwitch

Wend

Thanks in advance!

Share this post


Link to post
Share on other sites

The problem is what you have after the loop... Exit :x Also you are not handling the [X] messages at all, so nothing will happen when you click it. JoHanatCent got it right with that tutorial, you'll learn a lot and maybe see your problems easier.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...