Sign in to follow this  
Followers 0
dantay9

Progress Bar with Label

4 posts in this topic

I am trying to make a progress bar with a label in the middle of it, but when the progress bar refreshes, the label is hidden. Is there a way to make the label always on top of the progress bar?

$GUI = GUICreate("Downloading Foxit", 295, 61, 332, 223)
$Progress = GUICtrlCreateProgress(8, 32, 275, 20)
GUICtrlCreateLabel("Please Wait...", 8, 8, 275, 20, 1); SS_CENTER
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$Percent = GUICtrlCreateLabel("", 8, 32, 275, 20, 1); SS_CENTER
GUICtrlSetBkColor(-1, -2); GUI_BKCOLOR_TRANSPARENT
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
GUICtrlSetState(-1, 2048); GUI_ONTOP
GUISetState(@SW_SHOW)

$Size = InetGetSize("http://foxit.vo.llnwd.net/o28/pub/foxit/reader/desktop/win/3.x/3.0/enu/FoxitReader30_enu_Setup.exe")
InetGet("http://foxit.vo.llnwd.net/o28/pub/foxit/reader/desktop/win/3.x/3.0/enu/FoxitReader30_enu_Setup.exe", @DesktopDir & "\Foxit.exe", 1, 1)
While @InetGetActive
    If GUICtrlRead($Percent) <> Ceiling(@InetGetBytesRead / $Size * 100) Then
        GUICtrlSetData($Percent, Ceiling(@InetGetBytesRead / $Size * 100) & '%')
    EndIf
    If GUICtrlRead($Progress) <> Ceiling(@InetGetBytesRead / $Size * 100) Then
        GUICtrlSetData($Progress, Ceiling(@InetGetBytesRead / $Size * 100))
    EndIf
    Sleep(100)
WEnd

[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites



You could put the label in the loop, but that would cause some flicker... :D

There is a better 'Progress UDF' around here somewhere...

Share this post


Link to post
Share on other sites

Have you tried setting the extended style for the label to $WS_EX_TOPMOST


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

$WS_EX_TOPMOST doesn't work. I found a really good udf though. It is from the german forum by progandy.

http://progandy.pr.funpic.de/index.php/com.../id,17/lang,de/


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

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  
Followers 0