Jump to content

Close GUI Form1


1bobby
 Share

Recommended Posts

Not sure if this can be done at least I have not found it yet, but it is running on several of my scripts and I would like to remove it!

Once information has been entered into a GUI (Form1) and you get out of the loop, is there anyway to close or remove the Form1 window from the screen while the data is validated.. Then if the input data is bad, re-open the screen as a do over with the original Form1 window displaying the data that was input by the user so they can change/correct it??

Seems like I run the whole script with the original Form1 screen in back of the running Windows

Thanks bobby

Link to comment
Share on other sites

When I try the three suggestions, although seems like they should work anywhere out of the loop, I get

"C:\Documents and Settings\bobbyb\Desktop\EOC\EOC Menu.au3(58,31) : ERROR: $Form1_1: undeclared global variable."

I did put them in the first function after the loop thinking I wouldn't need it anymore. Maybe I am just not using them in the correct location?

bb

Link to comment
Share on other sites

#include <GUIConstants.au3>

$MyGUI = GUICreate("My GUI", 294, 70, 193, 159)
GUICtrlCreateLabel("Enter ""autoit"" in input box located down!", 7, 10, 205, 17)
$input = GUICtrlCreateInput("", 8, 35, 186, 21)
$ok = GUICtrlCreateButton("ok", 202, 36, 75, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $ok
            GuiSetState(@SW_HIDE, $MyGUI) ;Hides the window while data is processed
            Sleep(500) ;We want to get impression as something is doing, right? ;)
            If GuiCtrlRead($input) <> "autoit" Then
                GuiSetState(@SW_SHOW, $MyGUI) ;Show GUI again if user didn't enter AutoIt
            Else
                MsgBox(0, "", "Waay to goooo! You did it!")
                Exit
            EndIf
    EndSwitch
WEnd

:)

Edited by i486

I can do signature me.

Link to comment
Share on other sites

That is one the belongs in the examples, Thank you so much worked really cool and is surly a help to us newbies.

You're welcome. (Well, this is actually first time I get "thank you" PM from somebody...)

I can do signature me.

Link to comment
Share on other sites

You're welcome. (Well, this is actually first time I get "thank you" PM from somebody...)

I get a few of those, some of the newbies that have small questions, but don't really want a topic for it, PM me, and I PM back. :)
Link to comment
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
 Share

  • Recently Browsing   0 members

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