Jump to content
Sign in to follow this  

Help getting a checkbox to float over a button

Recommended Posts



I'm trying to get a checkbox to float above a button. I used GUICtrlSetState with $GUI_ONTOP on the checkbox, and it enables the box to be checked, but it doesn't keep it visible. Am I doing something wrong, or can anyone point out an alternate way?



Example code:

#include <GUIConstants.au3>
; Define the GUI
$GUIHandle= GUICreate("Button-Checkbox Experiment", 574, 469, -1, -1)
    $Button= GUICtrlCreateButton("Button", 10, 10, 100, 25)
    $Checkbox= GUICtrlCreateCheckbox("", 85, 15, 15, 15)
        GUICtrlSetState($Checkbox, $GUI_ONTOP)
    $OutputWindow= GUICtrlCreateEdit("", 10, 120, 300, 300)
GuiSetState ()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
        Case $msg = $Button
            GUICtrlSetData($OutputWindow, "Button" & @CRLF & GUICtrlRead($OutputWindow))
        Case $msg = $Checkbox
            GUICtrlSetData($OutputWindow, "Checkbox" & @CRLF & GUICtrlRead($OutputWindow))
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Share this post

Link to post
Share on other sites

Give the button $WS_CLIPSIBLINGS style.

"be smart, drink your wine"

Share this post

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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.