Sign in to follow this  
Followers 0

Transparent background

9 posts in this topic

Posted

I'm trying to create two simple buttons, a status message, with a picture that will show through the background. I don't want the buttons to be transparent. Meaning the checkbox's, status message. I can't seem to get the groups to show the image? I've included the script and image. Thanks for any help.

Posted Image

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Please select to continue", 271, 190, 223, 126)
$Group1 = GUICtrlCreateGroup("Settings", 8, 8, 257, 97)
GUICtrlSetColor(-1, 0xFF0000)
$Checkbox1 = GUICtrlCreateCheckbox("Start", 32, 72, 57, 17)
$Checkbox2 = GUICtrlCreateCheckbox("Pwned", 192, 72, 57, 17)
$Button1 = GUICtrlCreateButton("Start", 24, 24, 73, 41, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Pwned!!", 184, 24, 73, 41, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Status", 8, 112, 257, 65)
GUICtrlSetColor(-1, 0xFF0000)
$Label2 = GUICtrlCreateLabel("What's Next?", 48, 144, 161, 17, $SS_CENTER)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pic1 = GUICtrlCreatePic("freeqavatar.jpg", 0, 0, 268, 188, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUICheckBoxSetColor ( $Checkbox1 ,0x000000,$GUI_BKCOLOR_TRANSPARENT)
GUICheckBoxSetColor ( $Checkbox2 ,0x000000,$GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW)

Func GUICheckBoxSetColor(ByRef $CtrlID,$iColor,$iBkColor="0xF1EDED")
    $CtrlHWnd = $CtrlID
    If Not IsHWnd($CtrlHWnd) Then $CtrlHWnd = GUICtrlGetHandle($CtrlID)
    $aParent = DllCall("user32.dll", "hwnd", "GetParent", "hwnd", $CtrlHWnd)
    $aCPos = ControlGetPos($aParent[0],"",$CtrlID)
    $sOldT = GUICtrlRead($CtrlID,1)
    GUICtrlDelete($CtrlID)
    DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 0)
    $CtrlID = GUICtrlCreateCheckbox($sOldT,$aCPos[0],$aCPos[1],$aCPos[2],$aCPos[3])
    GUICtrlSetColor(-1,$iColor)
    GUICtrlSetBkColor(-1,$iBkColor)
    DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 7)
EndFunc


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

	EndSwitch
WEnd

Share this post


Link to post
Share on other sites



Posted

Was playing around with it and I moved

$Pic1 = GUICtrlCreatePic("freeqavatar.jpg", 0, 0, 268, 188, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

right below the

$Form1 = GUICreate("Please select to continue", 271, 190, 223, 126)

Which got me to this image:post-51714-12665577701096_thumb.jpg

So now how do I get the text to only be visible and not the box around it?

Share this post


Link to post
Share on other sites

Posted

Try this;

$Label2 = GUICtrlCreateLabel("What's Next?", 48, 144, 161, 17, $SS_CENTER)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

This does not work on checkboxes. The best thing you can do with checkboxes is to create a label next to it, and make the label transparant while the checkbox is minimized till only the "check" is left... i don't know how to get the other controls transparant.

Share this post


Link to post
Share on other sites

Posted

Try this;

$Label2 = GUICtrlCreateLabel("What's Next?", 48, 144, 161, 17, $SS_CENTER)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

This does not work on checkboxes. The best thing you can do with checkboxes is to create a label next to it, and make the label transparant while the checkbox is minimized till only the "check" is left... i don't know how to get the other controls transparant.

That worked wonderfully, I'll do as you stated and make a label next to them. Thanks for the ideas. Any one know how to get the Groups to show transparent?

Share this post


Link to post
Share on other sites

Posted (edited)

Freequency,

Does this help?

$Group2 = GUICtrlCreateGroup("", 8, 112, 257, 65)
GUICtrlCreateLabel("Status", 20, 122, 40, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

You can do the top one yourself if you like it! :mellow:

M23

P.S. You need to disable your Pic control if you want the others to work! :(

$Pic1 = GUICtrlCreatePic("freeqavatar.jpg", 0, 0, 268, 188, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUICtrlSetState(-1, $GUI_DISABLE)
Edited by Melba23

Share this post


Link to post
Share on other sites

Posted

Freequency,

Does this help?

$Group2 = GUICtrlCreateGroup("", 8, 112, 257, 65)
GUICtrlCreateLabel("Status", 20, 122, 40, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

You can do the top one yourself if you like it! :mellow:

M23

It sets the status color to white, but I still have the background box around it.

Also I did create the GuiCtrlSetState(-1,$GUI_DISABLE)to activate the script. Didn't put it in the code when I pasted it here.

Share this post


Link to post
Share on other sites

Posted

Freequency,

If you do not want the box, then why are you using GUICtrlCreateGroup? Just leave that line out and just use the label. :mellow:

M23

Share this post


Link to post
Share on other sites

Posted

Freequency,

If you do not want the box, then why are you using GUICtrlCreateGroup? Just leave that line out and just use the label. :mellow:

M23

Yea, that will have to do.. lol good point!

Share this post


Link to post
Share on other sites

Posted

Yea, that will have to do.. lol good point!

If you want a transparent box then an easy way is to create lines from labels with no text.

EG

GuiCtrlCreateLabel("",10,10,230,2)

GuiCtrlSetBkColor(-1,0x444444)

Possibly a bit late now though :mellow:

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

  • Recently Browsing   0 members

    No registered users viewing this page.