dreamzboy Posted March 6, 2015 Share Posted March 6, 2015 (edited) Hello, I would like to know how to go about making the following item clear and transparent. They're currently being highlight by a blue/black bar over the texts. I've read through pages and pages of "transparent group, radios, and checkboxes" but none looks like a simple implemenation nor does it apply to my case. Groups Text Radio Text Also, I'm unable to see my tabs perhaps it's being hidden by the background picture? (see figure 2 for what it's supposed to look like). Using the code from AdmiralClaws, it made the radio graphic or style a little plain and I would like to restore it. I don't need the tab section transparent, just the dark grey area around it. Example: $chk = GUICtrlCreateCheckbox("This is checkbox - Lorem ipsum dolor sit amet.", 20, 20) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0) $lbl = GUICtrlCreateLabel("This is label - Lorem ipsum dolor sit amet", 20, 100) $rdo = GUICtrlCreateRadio("This is radio - Lorem ipsum dolor sit amet", 20, 180) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0) Test Program expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 400, 300) ; GUICtrlCreatePic (".\background.bmp", 0, 0, 400, 300) GUICtrlCreateTab (20, 20, 360, 260) GUICtrlCreateTabItem ("Option 1") GUICtrlCreateGroup ("Radio", 40, 60, 320, 200) $radio1 = GUICtrlCreateRadio ("Radio 1", 60, 80) ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($radio1), "wstr", 0, "wstr", 0) $radio2 = GUICtrlCreateRadio ("Radio 2", 60, 110) ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($radio2), "wstr", 0, "wstr", 0) GUICtrlCreateTab (30, 30, 360, 260) GUICtrlCreateTabItem ("Option 2") GUICtrlCreateGroup ("Radio", 40, 60, 320, 200) $radio3 = GUICtrlCreateRadio ("Radio 3", 60, 80) ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0) $radio4 = GUICtrlCreateRadio ("Radio 4", 60, 110) ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Delete the previous GUIs and all controls. GUIDelete($hGUI) EndFunc ;==>Example (Figure 1) (Figure 2) Edited March 6, 2015 by dreamzboy Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted March 6, 2015 Moderators Solution Share Posted March 6, 2015 dreamzboy,Create the background picture after the tabs and set the $WS_CLIPSIBLINGS style - then you see the tab control. In this example I have also corrected the tab creation code and added a little extra code to force the tabs to fill the entire control (otherwise you get a nasty grey area at top right where there are no tabs): expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <TabConstants.au3> Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 400, 300) $cTab = GUICtrlCreateTab (20, 20, 360, 260, $TCS_FIXEDWIDTH) ; Add style for user-defined tab width GUICtrlCreateTabItem ("Option 1") GUICtrlCreateGroup ("Radio A", 40, 60, 320, 200) $radio1 = GUICtrlCreateRadio ("Radio 1", 60, 80) ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($radio1), "wstr", 0, "wstr", 0) $radio2 = GUICtrlCreateRadio ("Radio 2", 60, 110) ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($radio2), "wstr", 0, "wstr", 0) GUICtrlCreateTabItem ("Option 2") GUICtrlCreateGroup ("Radio B", 40, 60, 320, 200) $radio3 = GUICtrlCreateRadio ("Radio 3", 60, 80) ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0) $radio4 = GUICtrlCreateRadio ("Radio 4", 60, 110) ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0) GUICtrlCreateTabItem ("") ; Force tabs to cover whole width of control $aPos = ControlGetPos($hGUI, "", $cTab) Local $iTabWidth = Int(($aPos[2] - 3) / 2) Local $iTabHeight = Int(20 * $iTabWidth / 190) Local $iParam = BitOR(BitAND($iTabWidth, 0xFFFF), BitShift(BitAND($iTabHeight, 0xFFFF), -16)) GUICtrlSendMsg($cTab, $TCM_SETITEMSIZE, 0, $iParam) GUICtrlCreatePic ("Image_path", 0, 0, 400, 300, $WS_CLIPSIBLINGS) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlSetState(-1, $GUI_DISABLE) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Delete the previous GUIs and all controls. GUIDelete($hGUI) EndFunc ;==>ExampleI hope that helps. M23 Macrostop 1 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 Link to comment Share on other sites More sharing options...
dreamzboy Posted March 13, 2015 Author Share Posted March 13, 2015 Thanks Melba for coming through. Nice to have you looked at my thread. I think what you've suggested should do it. Cheers! Link to comment Share on other sites More sharing options...
Macrostop Posted August 1, 2023 Share Posted August 1, 2023 (edited) Thank you Melba23 (Once again) Your example saved my day. Very rare info about 'Tabs over background picture'. M. Edited August 1, 2023 by Macrostop Link to comment Share on other sites More sharing options...
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