Jump to content

Transparent radio with background image


Recommended Posts

Hey guys, I'm having a problem making radio buttons transparent. I've read the help file and tried many different things I saw on the forums, but the best I can do is make the background of the button black instead. I think the problem lies in the fact that I have a background image in the GUI.

#Region Main GUI
$GUI_Main = GUICreate("Search Engine", 610, 430, 300, 200,$WS_GROUP)
$Picture = GUICtrlCreatePic(@ScriptDir & "\back.jpg",0,0,600,400,$WS_GROUP,$WS_EX_LAYERED)
GUICtrlSetState(-1,$GUI_DISABLE)
$Search = GUICtrlCreateButton("Search",168, 296, 257, 25, $WS_GROUP)
$Input = GUICtrlCreateInput("",  176, 272, 241, 21,$WS_GROUP)
$Bob = GUICtrlCreateRadio("Bobby",  56, 200, 113, 17)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Suzy = GUICtrlCreateRadio("Suzy", 56, 224, 113, 17)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label1 = GUICtrlCreateLabel("Provider:", 56, 176, 46, 17)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label2 = GUICtrlCreateLabel("Search Terms:", 176, 248, 73, 17)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW, $GUI_Main)
#EndRegion

The labels are transparent, as they should be, but the radio boxes aren't.

Link to post
Share on other sites

when you ask for help try to add a worwing code... -.-

You will need winapiex UDF..

#include <windowsconstants.au3>
#include <GUIConstantsEx.au3>
#include <winapiex.au3>
$image = @Scriptdir&"\test.jpg"
If not fileexists($image) then Inetget("http://i273.photobucket.com/albums/jj239/StarcraftImages/MCR.jpg",@Scriptdir&"\test.jpg")
#Region Main GUI
$Theme = _WinAPI_GetThemeAppProperties()
$GUI_Main = GUICreate("Search Engine", 610, 430, 300, 200,$WS_GROUP)
$Picture = GUICtrlCreatePic($image,0,0,600,400,$WS_GROUP,$WS_EX_LAYERED)
GUICtrlSetState(-1,$GUI_DISABLE)
$Search = GUICtrlCreateButton("Search",168, 296, 257, 25, $WS_GROUP)
$Input = GUICtrlCreateInput("",  176, 272, 241, 21,$WS_GROUP)
_WinAPI_SetThemeAppProperties($STAP_ALLOW_NONCLIENT)
GUICtrlSetDefColor(0x00FF00)
$Bob = GUICtrlCreateRadio("Bobby",  56, 200, 113, 17)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Suzy = GUICtrlCreateRadio("Suzy", 56, 224, 113, 17)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label1 = GUICtrlCreateLabel("Provider:", 56, 176, 46, 17)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label2 = GUICtrlCreateLabel("Search Terms:", 176, 248, 73, 17)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetDefColor(0x000000)
_WinAPI_SetThemeAppProperties($Theme)
GUISetState(@SW_SHOW, $GUI_Main)
#EndRegion
Do
until GuiGetMsg() = -3

EDIT: Sorry i didn`t see that you are new. welcome to the forum, the link to download the winapiex UDF is this...

Also edit the code changing the text color because the image is too dark and the text to. enjoy it and ask if you have any doubt.

Edited by monoscout999
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...