Jump to content
Sign in to follow this  

Close one GUI and open a new GUI

Recommended Posts

Hi, I'm playing around with Servers and Clients in AutoIT, and I wanted to have an inital GUI (see code 1) where I can specify my port and IP then click a button to start the server, when I click the button I want the current GUI to close and a new GUI to open, how would I go about doing such a thing?


So basically, the question boils down to: How do I remove a window created by GUICreate?



func ServerLauncher()
   ; Server Init
   $MainForm = GUICreate("Server Starter", 158, 113, 192, 124)
   $IP = _GUICtrlIpAddress_Create($MainForm, 16, 16, 130, 21)
   _GUICtrlIpAddress_Set($IP, "")
   $Port = GUICtrlCreateInput("Port", 56, 44, 49, 21)
   $bStartServer = GUICtrlCreateButton("Start Server", 40, 72, 75, 25)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
         Case $bStartServer
Edited by Hylia

Share this post

Link to post
Share on other sites

Ok I solved it, instead of calling GUIDelete($MainFom) in my second GUI code, I had to call it at:

 Case $bStartServer

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  

  • Create New...