Sign in to follow this  
Followers 0
demonsc

GUICheckBox (Nothing huge)

3 posts in this topic

Just need small help on this one thing.

Basically all i want this to do is, IF this check Box is checked then DO THIS FUNCTION, otherwise if the checkbox is not checked DON'T DO IT, how would something like this work. I'm almost done making my program :P

Share this post


Link to post
Share on other sites

Example:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("CheckBox", 160, 94)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox 1", 40, 24, 81, 17)
$Button1 = GUICtrlCreateButton("Test", 40, 56, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then
                MsgBox(0, 'Example', 'Checkbox 1 check')
            Else
                MsgBox(0, 'Example', 'Checkbox 1 uncheck')
            EndIf
    EndSwitch
WEnd


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

Example:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("CheckBox", 160, 94)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox 1", 40, 24, 81, 17)
$Button1 = GUICtrlCreateButton("Test", 40, 56, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then
                MsgBox(0, 'Example', 'Checkbox 1 check')
            Else
                MsgBox(0, 'Example', 'Checkbox 1 uncheck')
            EndIf
    EndSwitch
WEnd
Thats all i need thanks alot :P

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