Sign in to follow this  
Followers 0
zamboni128

How to reconize when a button is pushed

4 posts in this topic

I've been trying different things and researching how to tell when the user press the OK button in the attached script. Can someone help please.

Thanks in Advance

Listbox.au3

Share this post


Link to post
Share on other sites



Think about this part:

Local $hGUI, $sMsg

And:

Switch $sMsg
    Case $Button_Ok
        Exit
EndSwitch

What is $sMsg? Nothing. Do you really want to Switch nothing? Don't you want it to actually do something?

Either you made a mistake, or you have no idea what you're doing. Read "GUI Reference" in the helpfile if you are unsure.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

zmboni128,

If you change this:

; Loop until user exits
         Do
        Switch $sMsg
            Case $Button_Ok
                Exit
        EndSwitch
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>_Main

to this:

; Loop until user exits
While 1
        $sMsg = GUIGetMsg()
        Switch $sMsg
            Case $Button_Ok
                Exit
                
            Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
WEnd

it'll work.

4Eyes

Edited by 4Eyes

Share this post


Link to post
Share on other sites

Thank you for your help.

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  
Followers 0