Jump to content

Transparent and always on top (of progressbar)


Aceguy
 Share

Recommended Posts

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)
Link to comment
Share on other sites

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

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()
Link to comment
Share on other sites

#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

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...