Jump to content

GUICheckBox (Nothing huge)


demonsc
 Share

Recommended Posts

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

Link to comment
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
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...