Jump to content

Help getting a checkbox to float over a button


Zealot
 Share

Recommended Posts

Hello,

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?

Thanks,

Simon

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()
    Select
        Case $msg = $Button
            GUICtrlSetData($OutputWindow, "Button" & @CRLF & GUICtrlRead($OutputWindow))
        Case $msg = $Checkbox
            GUICtrlSetData($OutputWindow, "Checkbox" & @CRLF & GUICtrlRead($OutputWindow))
    EndSelect
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Link to comment
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
 Share

  • Recently Browsing   0 members

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