Jump to content

I need Help with autoit progress bar


Go to solution Solved by Subz,

Recommended Posts

  • Solution

It depends on how you want to display the progress for example, if you have 5 vbscripts and you want the bar to progress each time the new vbscript is executed you could just place your vbscripts into an array and then upon each execution you progress the bar by 100/arraycount for example:

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>

Local $aVBExample[] = ["Execute VBScript 1","Execute VBScript 2","Execute VBScript 3","Execute VBScript 4","Execute VBScript 5"]

GUICreate("Progressbar1", 220, 40, 100, 200)
Local $idProgressbar = GUICtrlCreateProgress(10, 10, 200, 20)
GUISetState(@SW_SHOW)
Local $iProgress = 100/(UBound($aVBExample))
For $i = 0 To UBound($aVBExample) - 1
    $iProgressBar = GUICtrlRead($idProgressbar) + $iProgress
    GUICtrlSetData($idProgressbar, $iProgressBar)
    MsgBox(4096, "", $aVBExample[$i], 2)
Next

If your vbscripts take a long time to complete then would recommend using marquee, otherwise the end user may think the script is frozen, for example:

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>

Local $aVBExample[] = ["Execute VBScript 1","Execute VBScript 2","Execute VBScript 3","Execute VBScript 4","Execute VBScript 5"]

GUICreate("Progressbar2", 220, 40, 100, 200)
Local $idProgressbar = GUICtrlCreateProgress(10, 10, 200, 20, $PBS_MARQUEE)
GUISetState(@SW_SHOW)
GUICtrlSendMsg($idProgressbar, $PBM_SETMARQUEE, 1, 50)
For $i = 0 To UBound($aVBExample) - 1
    MsgBox(4096, "", $aVBExample[$i], 2)
Next

 

Edited by Subz
Link to comment
Share on other sites

thanks for code it worked but when i put it in my script. ikeep getting a error message which says that the $PBS_MARQUEE and PBM_SETMARQUEE

variables are used without being declared. itried to install marquee udf but istill get the same error message.

any idea how can i get through this? 

Thanks. 

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