Jump to content

Recommended Posts

Posted

I just started working with GUIs, and am having a bit of trouble. I want my checkboxes to be transparent as I have an image as the background. I searched the forums for an answer, but most threads relating to transparent checkboxes just sorta trailed off. Is an OwnerDrawn checkbox the only solution? One guy said he used GUICtrlSetBkColor($checkboxid, 0x00000020), but that did not work. I also tried using GUICtrlSetBkColor($checkboxid, -2), like I would for a label, with no success....

My second question is about combo boxes and my background image. My background image is set up as such:

$background = GUICtrlCreatePic("AU3-2.bmp", 0, 0, 450, 400)
GUICtrlSetState($background, $GUI_DISABLE)

The boxes work fine if I remove the background image, but when I have the image in use, the boxes aren't at "the front"....and if they are, they look odd (no border or dropdown arrow). Advice?

Thanks.

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Posted

#include <GuiConstants.au3>

GUICreate("Gui", 500, 500)
$pic = GUICtrlCreatePic(@SystemDir & "\oobe\images\wpaflag.jpg",0,0,500,500)
GUICtrlSetState($pic, $GUI_DISABLE)

$checkbox = GUICtrlCreateCheckbox("",10,10,12,12)
$label = GUICtrlCreateLabel("My Check Box", 22, 10, 90, 12)
GUICtrlSetBkColor($label, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor($label, 0xffffff)
$combo_stats = GUICtrlCreateCombo ("Strength", 10, 40, 120, 120, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1,"Dexterity|Vitality|Intelligence|Wisdom","Wisdom")
GUISetState()
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
            Case $checkbox, $label
                If BitAND(GUICtrlRead($checkbox), $GUI_CHECKED) Then
                    GUICtrlSetState($checkbox, $GUI_UNCHECKED)
                Else
                    GUICtrlSetState($checkbox, $GUI_CHECKED)
                EndIf
                MsgBox(0,"Test", "Check Box")
    EndSwitch
WEnd
Exit

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Posted

Ah, it was the width and height on the checkbox create that can get rid of that, thanks :whistle:

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

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
×
×
  • Create New...