Jump to content

GUI Button on top of Lable

Recommended Posts


Not sure what is wrong here. If I keep the Button after Lable, I can see the button but cannot click. If I keep it before Lable I can only see it if I click on it.

I even tried with GUICtrlSetState($Button1, $gui_ontop) but it's still the same.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 405, 293, 333, 307)

$Button1 = GUICtrlCreateButton("Button1", 168, 120, 75, 25)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000080)

$Label1 = GUICtrlCreateLabel("Label1", 64, 64, 268, 161)
GUICtrlSetBkColor(-1, 0x008000)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE

        Case $Button1
            MsgBox(0, '', 'Button 1')



Share this post

Link to post
Share on other sites

OK, I found it.

Just added GUICtrlSetStyle(-1, $SS_CENTER) after the lable and it worked. :)

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


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.