Sign in to follow this  
Followers 0
LoadStar

Progress bar and Percentages.

4 posts in this topic

I am attempting to make a progress bar that counts down each second. My problem comes when the numbers are larger than 100. I understand that the maximum value of the progressbar is 100.

Here is a sample of what I have:

$sTime = GUICtrlCreateInput("", 270, 70, 51, 21, 0x2000)

Func _progressbar()
   $time = GUICtrlRead($sTime)
   GUICtrlSetData($Progress1, 100)
   For $i = 0 to 100
      GUICtrlSetData($Progress1, $i)
      Sleep(1000)
   Next
EndFunc ; _progressbar()

I've been looking up lots of equations to try to get $time = 100 and get the interval it increases by = to 5/$time. In the end it still ends up being $time, of course. Is there something I am missing?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I was wrong sry.

Edited by markyrocks

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Something like this?:

$sTime = GUICtrlCreateInput("", 270, 70, 51, 21, 0x2000)

Func _progressbar()
   $time = GUICtrlRead($sTime)
   GUICtrlSetData($Progress1, 100)
   For $i = $Time to 0 step -1
      GUICtrlSetData($Progress1, 100/$time*$i)
      Sleep(1000)
   Next
EndFunc ; _progressbar()

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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