Freequency Posted February 19, 2010 Posted February 19, 2010 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.expandcollapse popup#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
Freequency Posted February 19, 2010 Author Posted February 19, 2010 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: So now how do I get the text to only be visible and not the box around it?
notsure Posted February 19, 2010 Posted February 19, 2010 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.
Freequency Posted February 19, 2010 Author Posted February 19, 2010 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?
Moderators Melba23 Posted February 19, 2010 Moderators Posted February 19, 2010 (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! 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 February 19, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Freequency Posted February 19, 2010 Author Posted February 19, 2010 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! 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.
Moderators Melba23 Posted February 19, 2010 Moderators Posted February 19, 2010 Freequency,If you do not want the box, then why are you using GUICtrlCreateGroup? Just leave that line out and just use the label. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Freequency Posted February 19, 2010 Author Posted February 19, 2010 Freequency,If you do not want the box, then why are you using GUICtrlCreateGroup? Just leave that line out and just use the label. M23Yea, that will have to do.. lol good point!
martin Posted February 19, 2010 Posted February 19, 2010 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.EGGuiCtrlCreateLabel("",10,10,230,2)GuiCtrlSetBkColor(-1,0x444444)Possibly a bit late now though Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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