MyEarth Posted February 28, 2014 Share Posted February 28, 2014 (edited) Hello, I have searched aroud but i don't have find nothing about this: I want to make a button work like a checkbox, in this way: - With one click the button change the state from unpressed to pressed and remain pressed - The opposite, if state is pressed make it unpressed Thank you Edited February 28, 2014 by MyEarth Link to comment Share on other sites More sharing options...
Solution MyEarth Posted February 28, 2014 Author Solution Share Posted February 28, 2014 (edited) I have serched for button the is a style of a checkbox: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> $Form = GUICreate("Form", 247, 233, -1, -1) $Button = GUICtrlCreateCheckbox("I'm a button", 72, 56, 97, 33, $BS_PUSHLIKE) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button If GUICtrlRead($Button) = $GUI_CHECKED Then ConsoleWrite("PRESSED" & @CRLF) If GUICtrlRead($Button) = $GUI_UNCHECKED Then ConsoleWrite("UNPRESSED"& @CRLF) EndSwitch WEnd Edited February 28, 2014 by MyEarth Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now