Sign in to follow this  
Followers 0
longxx

Return value of Uncheck a Checkbox?!

3 posts in this topic

Hi.

The help file of the GUIcreatecheckbox is bit too simple,

and it doesn't say how to perform something when uncheck a checkbox?

Basically for my script (below), no matter I check or uncheck the checkbox,

the script all does the same thing (beeping).

How Do I make the script do different things for checking and unchecking a checkbox?

It's silly for a checkbox to do the same thing when you check/uncheck it

Thanks

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

    Local $checkbox, $msg
    GUICreate("My GUI Checkbox")
    $checkbox = GUICtrlCreateCheckbox("CHECKBOX 1", 10, 10, 120, 20)
    GUISetState()    
    
    While 1
            $msg = GUIGetMsg()

            Select
            Case $msg = $GUI_EVENT_CLOSE
                GUIDelete()
            Case $msg = $checkbox 
                beep(333,333)   
            EndSelect

    WEnd

Share this post


Link to post
Share on other sites



From the helpfile:

To obtain the value of the control see GUICtrlRead.

Share this post


Link to post
Share on other sites

From the helpfile:

To obtain the value of the control see GUICtrlRead.

Great, solved my problem

Thanks, Wish could +1 you but don't see that option?

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