Jump to content
Sign in to follow this  
Aceguy

Transparent and always on top (of progressbar)

Recommended Posts

Aceguy

the label dissapears when the progressbar starts, any ideas how to keep it always on top.

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 445, 193, 125)

$Progress1 = GUICtrlCreateProgress(48, 88, 353, 65)
$Label1 = GUICtrlCreateLabel("Label is on top", 80, 96, 116, 49)
    GUICtrlSetBkColor($Label1, $GUI_BKCOLOR_TRANSPARENT) 
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

sleep(2000)

for $ct=0 to 100
    GUICtrlSetData($Progress1,$ct)
    sleep(250)
Next

sleep(2000)

Share this post


Link to post
Share on other sites
bluelamp

replace your loop with this one:

for $ct=0 to 100
    GUICtrlSetData($Progress1,$ct)
    $Label1 = GUICtrlCreateLabel("Label is on top", 80, 96, 116, 49)
    sleep(250)
Next

It is flickering, but it works

Edited by bluelamp

Share this post


Link to post
Share on other sites
bluelamp

Thaknks for fast response, but it flickers REALLY bad.

You could use GDI+:

#include <GUIConstants.au3>
#Include <GDIPlus.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 445, 193, 125)

_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form1)
$Progress1 = GUICtrlCreateProgress(48, 88, 353, 65)
_GDIPlus_GraphicsDrawString ($hGraphic,"Label is on top", 80, 96)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

sleep(2000)

for $ct=0 to 100
    GUICtrlSetData($Progress1,$ct)
     _GDIPlus_GraphicsDrawString ($hGraphic,"Label is on top", 80, 96)
    sleep(250)
Next

sleep(2000)
_GDIPlus_GraphicsDispose ($hGraphic)
_GDIPlus_Shutdown()

Share this post


Link to post
Share on other sites
bluelamp

#include <GUIConstants.au3>
#Include <GDIPlus.au3>

_GDIPlus_Startup()
$Form1 = GUICreate("Form1", 625, 445, 193, 125)
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form1)
$hBrush = _GDIPlus_BrushCreateSolid (0xFFFF0000)
$hFormat = _GDIPlus_StringFormatCreate ()
$hFamily = _GDIPlus_FontFamilyCreate ("Arial")
$hFont = _GDIPlus_FontCreate ($hFamily, 12, 2)
$tLayout = _GDIPlus_RectFCreate (80,96, 0, 0)
$aInfo = _GDIPlus_GraphicsMeasureString ($hGraphic,"Label is on top", $hFont, $tLayout, $hFormat)
$Progress1 = GUICtrlCreateProgress(48, 88, 353, 65)
_GDIPlus_GraphicsDrawStringEx ($hGraphic,"Label is on top", $hFont, $aInfo[0], $hFormat, $hBrush)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
sleep(2000)
for $ct=0 to 100
    GUICtrlSetData($Progress1,$ct)
    _GDIPlus_GraphicsDrawStringEx ($hGraphic,"Label is on top", $hFont, $aInfo[0], $hFormat, $hBrush)
    sleep(250)
Next
sleep(2000)
_GDIPlus_GraphicsDispose ($hGraphic)
_GDIPlus_Shutdown()

<== with color

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.