dreamzboy

Transparent Groups, Radio, and Missing Tabs

3 posts in this topic

#1 ·  Posted (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

#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

test1.jpg

(Figure 1)

test2.jpg

(Figure 2)

Edited by dreamzboy

Share this post


Link to post
Share on other sites



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): :)

#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   ;==>Example
I hope that helps. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thanks Melba for coming through.  Nice to have you looked at my thread.  I think what you've suggested should do it.

Cheers!

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

  • Similar Content

    • nassausky
      By nassausky
      Hi all,
       
      Anyone have any idea how to close all open tabs except a specific one I manually open.  Assuming I don't know what is open in all the tabs except just the one I want to keep open.
       
      I didn't want to use sendkeys and I was trying to use the following code to list the title (or url) of the 3 open tabs and  after I got that part working I would just close the other 2. This sample only displays the title of the first open tab
      #include <IE.au3> Const $ie_new_in_tab = 0x0800 $oIE = _IECreate("https://www.autoitscript.com") __IENavigate($oIE, "https://www.autoitscript.com/forum/", 1, $ie_new_in_tab) ;(obj,url,wait,param) __IENavigate($oIE, "https://www.google.com/", 1, $ie_new_in_tab) ;(obj,url,wait,param) Local $aIE[1] $aIE[0] = 0 Local $i = 1, $oIE While 1     $oIE = _IEAttach("", "instance", $i)     If @error = $_IEStatus_NoMatch Then ExitLoop     ConsoleWrite(_IEPropertyGet($oIE, "title") & @CRLF)     ReDim $aIE[$i + 1]     $aIE[$i] = $oIE ;each item holds object     $aIE[0] = $i ;first item holds count     $i += 1 WEnd MsgBox($MB_SYSTEMMODAL, "Browsers Found", "Number of browser instances in the array: " & $aIE[0]) ; This doesn't return the list of tabs in the console just the first tab  
      Thanks for any and all help
    • Miliardsto
      By Miliardsto
      Hello I got these tabs
       
      Global $TabMain = GUICtrlCreateTabItem("Main") Global $Action = GUICtrlCreateTabItem("Actions") Global $TabThings = GUICtrlCreateTabItem("Things") As we know to change tab we have to click with mouse on tab name like here it looks like below.
      Is there possibility to change tab without click on the tab but change by click on button for example?

    • Skeletor
      By Skeletor
      Hi All,
      I know many newbies search for this feature.
      I decided to share this piece of code with everyone.
      Basically its a "splash screen" that has a transparent image.
      In a nutshell - Gui with a transparent gif.
      Enjoy...
      Download attachment....
       
      Splash Screen GUI.zip
    • kawliga751
      By kawliga751
      I am trying to script the opening of multiple tabs in IE with each tab having a separate login/password. I have been able to make a successful script that will open 3 separate IE sessions with the correct webpage and login or a script that will open 3 tabs in one session (which I want) but will not login. I have tried _IECreate, IEAttach etc. This is the script I am currently using . 
      #include <IE.au3> Const $navOpenInNewTab = 0x0800 Dim $oIE = _IECreate('http://asag.xxxxxxx.com/AAAA/index.htm') ;$o_IE.Navigate2('http://asag.xxxxxxx.com/apps/yyyyyyy/LogInSAG/login.asp', $navOpenInNewTab) ;$o_IE.Navigate2('http://asag.xxxxxxx.com/apps/yyyyyyy/LogInSAG/login.asp', $navOpenInNewTab) Call ("YYYYYYYSignIn") Func YYYYYYYSignIn () Local $username = _IEGetObjByName ($oIE,"uname") Local $password = _IEGetObjByName ($oIE,"pword") $oIE.Navigate2('http://asag.xxxxxxx.com/apps/xxxxxxx/LogInSAG/login.asp',2048) _IEFormElementSetValue ($username, "xxxxxxx") _IEFormElementSetValue ($password, "xxxxxxx") Send('{Enter}') EndFunc Call ("xxxxxxxSignIn") Func xxxxxxxSignIn () __IENavigate($oIE, "https://soa1gui.xxxxxxx.biz/gateway/NFServlet;jsessionid=1E3B8F6520DE0A1EC914A8ABB7E86341?NFH_MessageId=&NFH_Page=%2fpages%2fsearch%2fsearch.jsp", 1, 0x800) Local $domain = _IEGetObjByName ($oIE,"NF_CustomerID") Local $User_Name = _IEGetObjByName ($oIE,"NF_UserName") Local $Password = _IEGetObjByName ($oIE,"NF_Password") _IEFormElementSetValue ($domain, xxxxxxx") _IEFormElementSetValue ($User_Name, "xxxxxxx") _IEFormElementSetValue ($Password, "xxxxxxx") ;Send('{Enter}') EndFunc  
    • Skeletor
      By Skeletor
      Hi Guys,
      I've been reading this post ...
      When I came accross the examples, non of them had what I was looking for.
      I basically want to "snapshot" my GUI's multiple tabs and send them into the pdf.
      A little nudge from you guys would be great.
      Im really stuck with this one, therefore I have no code.
      Lets discuss or point me in a right direction... thanks alot