Rhyono Posted December 21, 2012 Share Posted December 21, 2012 I would like to be able to make it so that when a button is pressed, it remains in the "down" state until it is clicked again. Then be able to do a boolean check if the button is down. Is this a possibility with AutoIt or am I going to have to use checkboxes? Link to comment Share on other sites More sharing options...
Xandy Posted December 21, 2012 Share Posted December 21, 2012 (edited) You could crop some screenshots of the button in different states. Then use this: $button= guictrlcreatebutton("", 188, 5, 146, 27, $bs_bitmap);create button with $bs_bitmap flag ;then change the graphic with guictrlsetimage($button, @scriptdir&"graphicsbuttonpressed.bmp");your button pressed graphic ;or guictrlsetimage($button, @scriptdir&"graphicsbutton.bmp");your button graphic before pressed Of course you would have to choose some graphics and directory structure for yourself. Edited December 21, 2012 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
stormbreaker Posted December 21, 2012 Share Posted December 21, 2012 (edited) Checkbox is a better option, but you can make it look like a button: #include <GUIConstantsEx.au3> Example() Func Example() Local $msg GUICreate("My Example") ; will create a dialog box that when displayed is centered GUICtrlCreateCheckbox("My Button", 10, 10, 120, 20, 0x1000) GUISetState() ; will display an dialog box with 1 checkbox ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example Edited December 21, 2012 by MKISH Rhyono 1 ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 21, 2012 Moderators Share Posted December 21, 2012 Check the helpfile for _GUICtrlButton_SetState. The example script should point you in the right direction. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! 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