Sign in to follow this  
Followers 0
t0ddie

checkbox refresher

2 posts in this topic

#1 ·  Posted (edited)

bah.. i dont use this very often.. but i am trying to simply check whether the checkbox is checked or not.

#include <GUIConstants.au3>
GUICreate("test")  
$test = GUICtrlCreateCheckbox ("test", 10, 10, 120, 20)
GUISetState () 
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

i will be using some sort of "if" statement thats not in the gui loop. something like..

if $test = $gui_checked then
$1 = "cool"
endif

is that right? lol

so if someone could refresh me.. is this right? or is there another way

EDIT: i try this but it returns 80 whether checked or not

#include <GUIConstants.au3>
GUICreate("test")  
$test = GUICtrlCreateCheckbox ("test", 10, 10, 120, 20)
GUISetState () 
While 1
    $msg = GUIGetMsg()
$test2 = GUICtrlGetState($test)
msgbox(0,"test",$test2)
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Use GUICtrlRead

#include <GUIConstants.au3>
GUICreate("test")
$test = GUICtrlCreateCheckbox("test", 10, 10, 120, 20)
GUISetState()
While 1
    $msg = GUIGetMsg()
    If GUICtrlRead($test) = 1 Then
        ToolTip("Checked", 100, 100)
    Else
        ToolTip("Not Checked", 100, 100)
    EndIf
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
Edited by Geert

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