Jump to content

Recommended Posts

Posted

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?

Posted (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 by Xandy
Posted (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 by MKISH

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

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
  • Recently Browsing   0 members

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