Sign in to follow this  
Followers 0
Blue_Drache

Buttons vs. Labels

3 posts in this topic

#1 ·  Posted (edited)

Ok, my GUI layout has a specific colour scheme. The only way I've seen how to do this so far is to colour the background with lables, but ... I can't click any buttons I've built on top of the lables. I mean, it works when I comment out the large white label, and I can click on the buttons just fine...

Is this a limitation of AutoIt?

#include <GUIConstants.au3>

$main_GUI = GUICreate("Coaster Leech",231,341); will create a dialog box that when displayed is centered
GUISetBkColor(0x484b80)
GUICtrlCreateLabel ("", 10,10,211,60)
GUICtrlSetBkColor(-1,0xffff00); yellow.  For the image
; comment the following two lines to get the buttons to work again.
 GUICtrlCreateLabel("",10,80,211,251)
 GUICtrlSetBkColor(-1,0xffffff); white
; end comment section.
$button_banlist = GUICtrlCreateButton("View &Bans",15,85,65,20)
$button_config = GUICtrlCreateButton("&Config",151,85,65,20)

                
GUISetState ()

; Run the GUI until the dialog is closed
While 1
    Sleep(10)
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $button_banlist
            MsgBox(0,"Banlist","Insert Banlist GUI here")
        Case $msg = $button_config
            MsgBox(0,"Configuration","Config GUI goes here")
    EndSelect
Wend

I've got a work around, lots of extra coding to make a "hole" for the button(s) to sit in, but......I'd rather not if there's a simpler way.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites



Put the following after each GuiCtrlSetBkColor:

GuiCtrlSetState(-1, $GUI_DISABLE)

The other workaround would be to save your background as a *.bmp or *.gif image.

<{POST_SNAPBACK}>

Worked like a charm, thanks CS. I'll have to remember that....

As far as the image is concerned, the yellow label in my example was a placeholder for an image. There will be 3 images that I'll have to Fileinstall() anyway, and don't want to bloat the distribution any more than necessary.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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  
Followers 0