Jump to content
Sign in to follow this  

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)


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

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.

- Dan [Website]

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

@IceKirby1 - Lol, what exactly was that code meant to do? Looks like you were trying to break the record for most errors in fewest lines of code :P

Edited by dandymcgee

- Dan [Website]

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...