Jump to content

Close one GUI and open a new GUI


Hylia
 Share

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, "127.0.0.1")
   $Port = GUICtrlCreateInput("Port", 56, 44, 49, 21)
   $bStartServer = GUICtrlCreateButton("Start Server", 40, 72, 75, 25)
   GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
Case $GUI_EVENT_CLOSE
            Exit
         Case $bStartServer
            ExitLoop
    EndSwitch
 WEnd
EndFunc
Edited by Hylia
Link to comment
Share on other sites

  • 4 years later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...