Jump to content

Transparent Groups, Radio, and Missing Tabs


Go to solution Solved by Melba23,

Recommended Posts

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
Link to post
Share on other sites
  • Moderators
  • Solution

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

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.

  • Similar Content

    • By XGamerGuide
      I'm trying to display a GIF. However, the GUI should not be visible. Here is an attempt that doesn't work:
      $sGIF = "MyGIF.gif" #Include <IE.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WINAPI.au3> #include <SendMessage.au3> Global Const $SC_DRAGMOVE = 0xF012 HotKeySet("{ESC}", "_Exit") $hGui = GUICreate("Test", 400, 300, -1, -1, $WS_POPUP, $WS_EX_LAYERED) GUISetBkColor(0xABCDEF) $oIE = _IECreateEmbedded() GUICtrlCreateObj($oIE, 10, 10, 380, 280) _WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 250) _IENavigate($oIE, $sGIF) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_PRIMARYDOWN _SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) EndSwitch WEnd Func _Exit() Exit  
    • By MASKED
      hi guys
      i am using imagesearch2015 library. (used another one before)
      but transparency parameter doesn't working. how i can solve this problem.
       
      here's my code
      #include "ImageSearch2015.au3" #include <Date.au3> ; Script Start - Add your code below here Global $x = 0 Global $y = 0 HotKeySet("{UP}","hey") HotKeySet("{DOWN}","heyo") Func hey() $balikcisaniye = _Date_Time_GetTickCount() $array = _ImageSearchArea("bul.bmp", 1, 0, 0, @DesktopWidth, @DesktopHeight, $x, $y, 2,0x000000) if($array = True) Then $balikcisaniye1 = _Date_Time_GetTickCount() MouseMove($x,$y) MsgBox(1,"","Found." & $x & "-" & $y & " / " & $balikcisaniye1-$balikcisaniye) Else MsgBox(1,"","Not Found.") EndIf EndFunc Func heyo() exit EndFunc while 1 WEnd when i disable transparency parameter, it work normal. but with parameter, this function is always returning false.
      please help.
       
      here's library i use :
       
       
    • By Cengokill
      Hi everyone,
      I have created a ListView that is in a tab, and I want to display an image in that tab, with the ListView on top.
      However, the image still appears on top of my ListView.
      If I remove the tabs everything works. 
      I looked at the autoit documentation and the <GuiListView.au3> documentation , I can't figure out how to display a background image, and put on top a ListView, inside a tab. 😥
      Here is the code:
      Opt("GUIOnEventMode", 1) $Form1 = GUICreate($Titre, 700, 627, $Form1Width, $Form1Height); main window $tabulation = GUICtrlCreateTab(148,0,700,580); creating tabs $tab1=GUICtrlCreateTabItem("Tab 1"); first tab GUICtrlSetState(-1, $GUI_SHOW); this tab is selected by default $Pic1 = GUICtrlCreatePic("image.jpg", 0, 30, 700, 627) GUICtrlSetState(-1, $GUI_DISABLE). $idListview = GUICtrlCreateListView("list 1|list 2|list 3", 200, 50, 390, 200) GUISetState(@SW_SHOW) While 1     Sleep(100) WEnd Thank you in advance.

    • By red0fireus
      Hello, I'm a college student, and I have a Surface Book 2. Currently Microsoft has a stick up their ass and Windows Surface Books, after the 1903 windows update, have issues where the graphics card disconnects from the computer for no reason. (They still haven't fixed it)
      I have the Surface Book 2 13.5 Inch with a 1050 graphics card.
      I was looking for a fix online and decided to code something to try and fix it. I found that if I scan for hardware changes on the Device Manager then the graphics card will reappear. *Face Palm* I went and downloaded Devcon.exe last night and looked for example code online on how to check if a device no longer exists and if it doesn't then do "devcon rescan" and I'm going to assume this works. 
       
      If anyone has any better ideas, please post some. I've checked Reddit on how to fix this, and I've installed the Surface Book 2 Drivers. No Luck. Any recommendations would be helpful
      Things I've tried:
      Updating Windows to the Skip Beta version Reinstalling the Drivers multiple times with many different scenarios Checking for Updates (A lot) Uninstalling Software Running software as Administrator Cleaning the Devices Metal connector with Isopropyl alcohol 91% (Someone recommended it on Reddit) Installing the new NVIDIA graphic drivers (this just made it worse) Current Drivers: NVIDIA Update 31.1.10.0 NVIDIA Graphics Driver 391.40 Uninstalling the Graphic Drivers in Safe Mode with DDU Uninstaller #include "DeviceAPI.au3" $DeviceName = "NVIDIA Geforce GTX 1050" $DeviceClass = "Display adapters" ;$objWMIService = ObjGet("winmgmts:" & $strComputer & "rootCIMV2") ;$m_MediaConnectWatcher = $objWMIService.ExecNotificationQuery("SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_DiskDrive'") Do ConsoleWrite(@CRLF & "Checking for [" & $DeviceName & "]...") Sleep(5000) Until HWDevice_Detect($DeviceName, $DeviceClass) = True Func HWDevice_Detect($devicename, $classname) Local $DeviceListed = False Local $aClasses = _DeviceAPI_GetClassArray() For $X = 0 to Ubound($aClasses)-1 If $aClasses[$X][2] = $classname Then Local $aDevices = _DeviceAPI_GetDeviceArray($aClasses[$X][0]) For $Y = 0 to Ubound($aDevices)-1 If $aDevices[$Y][1] = $devicename Then $DeviceListed = True EndIf Next EndIf Next If $DeviceListed = True Then Sleep(1000) Else Run(@Comspec & " /c " & "devcon rescan") EndIf EndFunc This is the code i found and i tried to edit it but it doesn't work for what i need. It exits after it's true. I need it to constantly scan (and not cause high CPU usage) if that's possible. I was thinking scan every 15min?
      Proof of issue: Link Here to Microsoft
    • By kellariluukku
      Hello.
      I'm using SciTE v3.3.14.5 I think, and I find this very annoying (GIF):
      https://i.gyazo.com/e60b5d94b8c16d217be4010e208d7042.mp4
       
      I've searched around but found nothing that helped including this:
      https://www.autoitscript.com/forum/topic/100517-stop-scite-removing-tab-indentations/
       
      So the problem obviously is that when I go to a new line after "EndIf", it removes the tab which I don't want to happen.
      Is there any fix?
       
      I've tried to change some configs such as 
          Line 183: # Indentation     Line 185: indent.size=0     Line 187: #indent.auto=0     Line 188: indent.automatic=0     Line 189: indent.opening=0     Line 190: indent.closing=0     Line 191: #tab.indents=0     Line 192: #backspace.unindents=0 strip.trailing.spaces=0 But nothing seems to get rid of this.
       
      Thanks
×
×
  • Create New...