Welcome !
         

 ProgressBar Classic [HTA] (Level = easy)

Author Message
Fredledingue

  • Total Posts : 585
  • Scores: -5
  • Reward points : 0
  • Joined: 5/9/2005
  • Location: Europe
  • Status: offline
ProgressBar Classic [HTA] (Level = easy) Wednesday, May 30, 2007 12:44 PM (permalink)
0
Two version for this ProgressBar:
 
1/ for small number of items to proceed (less than 50).
The lenght (or number of steps) of the bar is proportional to the number of items
 
2/ for large numbers of items (more than 50)
The lenght of the bar is 50.
---
 
- Displays percents in the taskbar and the caption
 
- Diplay numbers of done items and the total.
 
- "classic" because of the greyish background, of course you can change the colors: white will make it Windows 3.1 style, blue and yellow: BSOD style etc)
 
---
To use them in a useful manner, you will have to figure out how to feed the "x" variable to the progress bar. You can either include the prgressbar code into an hta application (progress shown on the main window) or make it read a file generated by the main scrit with the datas needed for the progressbar.
This code can be easily modified to add extra infos, colors, them, pictures etc
 
---
 
1/ for small number of items to proceed (less than 50).
The lenght (or number of steps) of the bar is proportional to the number of items
 
 <html>
 <head>
 <title id="title">Zzzzz</title>
 <HTA:APPLICATION 
     ID="ProgressBar"
     APPLICATIONNAME="ProgressBar"
     SCROLL="no"
     MAXIMIZEBUTTON="no"
     />
 <SCRIPT Language="VBScript">
 
 Public x, y, MyTitle
 
 Sub Window_Onload
 window.resizeTo 436,116
 y=5
 MyTitle = " _ Zzzz"
 window.setInterval "Progress", 150
 End Sub
  
 Sub Progress
  x=x+1
  document.Title = FormatPercent(x/y, 0) & MyTitle
  document.all.ProgBarText.innerText = x & "/" & y
  document.all.ProgBarDone.innerText = String(x, "_")
  document.all.ProgBarToDo.innerText = String(y-x, "_") & "|"
   If x=y Then
   document.all.ProgBarToDo.innerText = ""
   MsgBox "ok"
   window.close
   End If
 End Sub
 
 </SCRIPT>
 </head>
 <body bgcolor="#D7D7D7">
 <span id="ProgBarText"></span><br>
 <span id="ProgBarDone" style="background-color: #3399FF"></span>
 <font color="#FFFFFF">
 <span id="ProgBarToDo"style="background-color: #C0C0C0"></span>
 </font>
 </body>
 </html>
 
 

 
 
2/ for large numbers of items (more than 50)
The lenght of the bar is 50.
 
 <html>
 <head>
 <title id="title">Zzzzz</title>
 <HTA:APPLICATION 
     ID="ProgressBar"
     APPLICATIONNAME="ProgressBar"
     SCROLL="no"
     MAXIMIZEBUTTON="no"
     />
 <SCRIPT Language="VBScript">
 
 Public w,x,y, MyTitle 
 '-- w: bar width, x: done items, y: remaining items
 
 Sub Window_Onload
 window.resizeTo 440,116
 w=50
 y=1352
 MyTitle = " _ Zzzz"
 window.setInterval "Progress", 150
 End Sub
  
 Sub Progress
  x=x+27
  d = Round( x / (y/w) +1  ,0)
  document.Title = FormatPercent(x/y, 0) & MyTitle
  document.all.ProgBarText.innerText = x & "/" & y
  document.all.ProgBarDone.innerText = String(d, "_")
   If d<w Then
   document.all.ProgBarToDo.innerText = String(w-d, "_") & "|"
   Else
   document.all.ProgBarToDo.innerText = "|"
   End If
   If x>=y Then
   document.all.ProgBarToDo.innerText = ""
   MsgBox "ok"
   window.close
   End If
 End Sub
 
 </SCRIPT>
 </head>
 <body bgcolor="#D7D7D7">
 <span id="ProgBarText"></span><br>
 <span id="ProgBarDone" style="background-color: #3399FF"></span>
 <font color="#FFFFFF">
 <span id="ProgBarToDo"style="background-color: #C0C0C0"></span>
 </font>
 </body>
 </html>
 
 

Fred
 
#1
    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2017 ASPPlayground.NET Forum Version 3.9