Jump to content

How can i sincronize the progress bar with the for loop?


Recommended Posts

I wish that when appear the message box "finish", the progress bar is at its 100%. How can I sync?

#include <GUIConstantsEx.au3>
#requireadmin

$Form           =  GUICreate("GUI",450,200)
$Button_find    =  GUICtrlCreateButton("Find",180,100,50,20)
$progressbar    =  GUICtrlCreateProgress(10, 150, 430, 20)
GUISetState(@SW_SHOW)

While 1
  $Msg = GUIGetMsg()
  Switch $Msg
    Case $Button_find
        start()
    Case $GUI_EVENT_CLOSE
        Exit
  EndSwitch
WEnd


Func start()
    For $i=0 To 50
        GUICtrlSetData($progressbar,$i)
        Sleep(100)
    Next
    MsgBox(0,"Finish","Finish")
EndFunc

Thanks bye!!

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