Mungo Posted January 6, 2011 Posted January 6, 2011 (edited) Setting $GUI_BKCOLOR_TRANSPARENT for checkboxes seems to behave differently under Windows XP choosing the "Windows classic" or "Windows XP" (default) display themes? I normally work with the "Windows classic" (Windows 2000 type) theme but realised the difference when I swapped. Or am I doing something wrong here? Any idea?CheersMungo#include <GUIConstantsEx.au3> transparency_example() Func transparency_example() Local $msg GUICreate("Transparency test ...", 300, 275) ; creates an orange background box GUICtrlCreateLabel("", 10, 10, 280, 125) GUICtrlSetBkColor(-1, 0xff8c00) GuiCtrlSetState(-1, $GUI_DISABLE) ; checkbox and label over the orange background GUICtrlCreateCheckbox("Transparency NOT SET", 25, 25, 250, 20) GUICtrlCreateCheckbox("Transparency SET", 25, 50, 250, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("Transparency NOT SET", 25, 75, 250, 14) GUICtrlCreateLabel("Transparency SET", 25, 100, 250, 14) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ; checkbox and label on default background GUICtrlCreateCheckbox("Transparency NOT SET", 25, 150, 250, 20) GUICtrlCreateCheckbox("Transparency SET", 25, 175, 250, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel("Transparency NOT SET", 25, 200, 250, 14) GUICtrlCreateLabel("Transparency SET", 25, 225, 250, 14) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFuncPS: Two screenshots - both under Win XP!: Left with "Windows classic " , right "Windows XP" desktop theme selected. Edited January 6, 2011 by Mungo
funkey Posted January 6, 2011 Posted January 6, 2011 $GUI_BKCOLOR_TRANSPARENT for checkboxes does not work now with AutoIt. Simply use a child gui instead of the orange label to show it the right way. #include <GUIConstantsEx.au3> transparency_example() Func transparency_example() Local $msg, $hParent, $hChild $hParent = GUICreate("Transparency test ...", 300, 275) ; checkbox and label over the orange background ; creates an orange background box $hChild = GUICreate("Child", 280, 125, 10, 10, 0x40000000, 0, $hParent) GUISetBkColor(0xff8c00) GUICtrlCreateCheckbox("Transparency NOT SET", 25, 25, 250, 20) GUICtrlCreateCheckbox("Transparency SET", 25, 50, 250, 20) GUICtrlCreateLabel("Transparency NOT SET", 25, 75, 250, 14, -1, 0x20) GUICtrlCreateLabel("Transparency SET", 25, 100, 250, 14);, -1, 0x20) GUISetState() GUISwitch($hParent) ; checkbox and label on default background GUICtrlCreateCheckbox("Transparency NOT SET", 25, 150, 250, 20) GUICtrlCreateCheckbox("Transparency SET", 25, 175, 250, 20) GUICtrlCreateLabel("Transparency NOT SET", 25, 200, 250, 14) GUICtrlCreateLabel("Transparency SET", 25, 225, 250, 14) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>transparency_example Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning.
Mungo Posted January 6, 2011 Author Posted January 6, 2011 Many thanks for the hint and the work around example! I only have XP (and Win2000) to test on. Any idea whether the $GUI_BKCOLOR_TRANSPARENT for checkboxes similarly does not work with later windows versions such as Vista and Windows 7 etc. ? Cheers Mungo
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now