itrn007 Posted January 25, 2008 Share Posted January 25, 2008 I am struggling with how to make a button APPEAR to be toggled. That is, when clicked once it will appear to be "pressed" or selected in some way, and when click again it will appear to be unpressed. This would be similar in function to the bold button on a word processor toolbar - it would stay "pressed" until clicked again. I am OK with the code behind the the states/actions. It is more the visuals that I am looking for Thanks all in advance. Link to comment Share on other sites More sharing options...
rasim Posted January 25, 2008 Share Posted January 25, 2008 This? #include <GuiConstants.au3> $hGui = GUICreate("Test to toggle", 200, 100) $button = GUICtrlCreateCheckbox("Toggle", 10, 70, 50, 25, $BS_PUSHLIKE) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $button Switch GUICtrlRead($button) Case $GUI_CHECKED ConsoleWrite("Button pressed" & @CRLF) Case $GUI_UNCHECKED ConsoleWrite("Button unpressed" & @CRLF) EndSwitch EndSwitch WEnd Link to comment Share on other sites More sharing options...
itrn007 Posted January 25, 2008 Author Share Posted January 25, 2008 Perfect! Exactly what i needed. I think the $BS_PUSHLIKE is the piece I was missing. Thanks! 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