Jump to content
Sign in to follow this  
dandymcgee

While Loop not working...

Recommended Posts

I just finished making this very simple GUI trying to practice my GUI skills. For some reason I can't get it to stay open no matter what I do. It seems as if While 1 loops isn't working for me... Here is what I have written:

#include <GUIConstants.au3>

GUICreate("Main Window", 200, 200)
$button = GUICtrlCreateButton("Pause", 110, 160, 60, 20)
$button2 = GUICtrlCreateButton("Number Two", 105, 130, 70, 20)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $button
            MsgBox(0, "Testing...", "Button 1")
        Case $msg = $button2
            MsgBox(0, "Testing...", "Button 2")
        Case $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

Now I'm sure there must be some really stupid mistake somewhere, but I don't see it. Sorry if this was a waste of your time, but I really can't figure this out. Thanks in advance.

Share this post


Link to post
Share on other sites

You just wrote "Case $GUI_EVENT_CLOSE"

Replace it with "Case $msg = $GUI_EVENT_CLOSE" :P


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

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...