Jump to content

Displaying a Progressbar through a transparent Label


TheOrignl
 Share

Recommended Posts

I created a Progressbar after a Label using the $WS_EX_TRANSPARENT and $WS_EX_TOPMOST extended styles on the Label.

$lbl_annc_path = GUICtrlCreateLabel($NOMED, $ANNC_LEFT+5, $ANNC_TOP+14+$PATH_OFFSET, $GROUP_LENGTH-10, 17, $SS_SUNKEN, _
BitOR($WS_EX_TRANSPARENT, $WS_EX_TOPMOST))

GUICtrlSetOnEvent($lbl_annc_path, "group_set")
$annc_progbar = GUICtrlCreateProgress($ANNC_LEFT+5, $ANNC_TOP+14+$PATH_OFFSET, $GROUP_LENGTH-10, 17, $PBS_SMOOTH)

That's not allowing the Progressbar to display through. Can any point out what I'm missing? Placing the creation of the Progressbar before the Label creation doesn't do the trick either.

Managing the complexities of our daily lives is always our own responsibility; Allowing God to help us and accepting His guidance is our choice. The best choice!

Link to comment
Share on other sites

TheOrignl

This?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

Global $iProgress = 0

$hGUI = GUICreate("Test", 300, 200)

GUICtrlCreateLabel("Progress bar demo", 10, 10, 280, 100, BitOR($SS_SUNKEN, $WS_CLIPSIBLINGS))

$ctlProgress = GUICtrlCreateProgress(50, 40, 200, 20)


GUISetState(@SW_SHOW)

AdlibEnable("_Progress")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

AdlibDisable()

Func _Progress()
    $iProgress += 5
    If $iProgress = 100 Then $iProgress = 0
    GUICtrlSetData($ctlProgress, $iProgress)
EndFunc   ;==>_Progress
Link to comment
Share on other sites

TheOrignl

This?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

Global $iProgress = 0
.  .  .
Not exactly. I'm trying to display the Progressbar under the text in the Label. I'll look into the $WS_CLIPSIBLINGS style though. Thanks. Edited by TheOrignl

Managing the complexities of our daily lives is always our own responsibility; Allowing God to help us and accepting His guidance is our choice. The best choice!

Link to comment
Share on other sites

This

#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 625, 445, 193, 125)

$Progress1 = GUICtrlCreateProgress(48, 88, 353, 65,Default)
GUICtrlSetColor(-1, 0x00FF00)
                
        DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", " ", "wstr", " ")
        GUICtrlSetStyle(-1, 1)
$Label1 = GUICtrlCreateLabel("Label is on top", 80, 96, 116, 49)
    GUICtrlSetBkColor($Label1, $GUI_BKCOLOR_TRANSPARENT) 


GUISetState(@SW_SHOW)

GUICtrlSetData($Progress1,0)
for $ct=0 to 100
    GUICtrlSetData($Progress1,$ct)
    GUICtrlSetData($Label1,"Label is on top")
    sleep(50)
Next

sleep(2000)
Exit
Link to comment
Share on other sites

This

#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 625, 445, 193, 125)

$Progress1 = GUICtrlCreateProgress(48, 88, 353, 65,Default)
GUICtrlSetColor(-1, 0x00FF00)
                
        DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", " ", "wstr", " ")
        GUICtrlSetStyle(-1, 1)
$Label1 = GUICtrlCreateLabel("Label is on top", 80, 96, 116, 49)
    GUICtrlSetBkColor($Label1, $GUI_BKCOLOR_TRANSPARENT) 


GUISetState(@SW_SHOW)

GUICtrlSetData($Progress1,0)
for $ct=0 to 100
    GUICtrlSetData($Progress1,$ct)
    GUICtrlSetData($Label1,"Label is on top")
    sleep(50)
Next

sleep(2000)
Exit
Exactly. Thank you for the example. Also I was successful in pulling out the pieces I need for my particular implementation. Given the use of DllCall, could you point me to or tell me how to obtain reference on Dll parameters? Edited by TheOrignl

Managing the complexities of our daily lives is always our own responsibility; Allowing God to help us and accepting His guidance is our choice. The best choice!

Link to comment
Share on other sites

OK I'm a pain and a perfectionist. I want to make the color of the text in the Label the color of the GUI Forum. But I also would like to change the color according to the current Windows theme. Is there a way to retrieve the 'messagebox' color of Windows?

Managing the complexities of our daily lives is always our own responsibility; Allowing God to help us and accepting His guidance is our choice. The best choice!

Link to comment
Share on other sites

OK I'm a pain and a perfectionist. I want to make the color of the text in the Label the color of the GUI Forum. But I also would like to change the color according to the current Windows theme. Is there a way to retrieve the 'messagebox' color of Windows?

hmm... read about _WinAPI_GetSysColor() in the helpfile.
Link to comment
Share on other sites

hmm... read about _WinAPI_GetSysColor() in the helpfile.

Ah Josbe you're good. It's as simple as GUICtrlSetColor($lbl_med_path, _WinAPI_GetSysColor($COLOR_3DFACE)). Thank you all for the responses and being a part of the Autoit Community. :)

Managing the complexities of our daily lives is always our own responsibility; Allowing God to help us and accepting His guidance is our choice. The best choice!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...