Jump to content

Help with Toggle Button

Recommended Posts

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 post
Share on other sites


#include <GuiConstants.au3>

$hGui = GUICreate("Test to toggle", 200, 100)

$button = GUICtrlCreateCheckbox("Toggle", 10, 70, 50, 25, $BS_PUSHLIKE)


While 1
    $msg = GUIGetMsg()
    Switch $msg
    Case $button
        Switch GUICtrlRead($button)
        Case $GUI_CHECKED
            ConsoleWrite("Button pressed" & @CRLF)
        Case $GUI_UNCHECKED
            ConsoleWrite("Button unpressed" & @CRLF)
Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...