Jump to content
Sign in to follow this  
dickep

Help closing GUI but running more code

Recommended Posts

dickep

OK, I am a newbee for the GUI stuff.

I used KODA to create a GUI window that I want to get a number. After that I want to close the input window GUI and just let the rest of the code run (actually calls and application over and over unit it runs out of loop counter). I just cannot find/figure out anything to close the GUI except to do an EXIT.

Can I do this?

#include <GUIConstants.au3>

$BatCalLoops = 0
#Region ### START Koda GUI section ### Form=
$BatCalUtil = GUICreate("Battery Calibration Utility", 335, 86, 106, 174)
$Label1 = GUICtrlCreateLabel("Enter Number of loops to run Battery Calibration:", 40, 20, 230, 17)
$BatCalLoops = GUICtrlCreateInput("", 280, 18, 30, 21)
$Button1 = GUICtrlCreateButton("OK", 160, 56, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            ExitLoop
    EndSwitch
WEnd

; code continues here

Thanks

E

Share this post


Link to post
Share on other sites
Swift

you could just do:

GUIDelete()

or...

GUISetState($gui, @SW_HIDE)

Share this post


Link to post
Share on other sites
dickep

you could just do:

GUIDelete()

or...

GUISetState($gui, @SW_HIDE)

I missed that in the help files - my bad.

WORKED WELL. Thank you very much Swift

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.