Sign in to follow this  
Followers 0
kaz

Progress bar

7 posts in this topic

Hello from france :shocked:

I created a progress bar with : $progressbar = GUICtrlCreateProgress (6,170,450,10)

i count a file number and i want to set the max of my progress with this file number.

i try GUICtrlSetLimit($progressbar,$my_number,0)

but it doesn't work!!

Is it really possible to change the max by code or i did something wrong ??

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hello from france :shocked:

I created a progress bar with : $progressbar = GUICtrlCreateProgress (6,170,450,10)

i count a file number and i want to set the max of my progress with this file number.

i try GUICtrlSetLimit($progressbar,$my_number,0)

but it doesn't work!!

Is it really possible to change the max by code or i did something wrong ??

ok i think me and lots of other could help IF you posted the whole script

Edited by SalazarCheats

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Share this post


Link to post
Share on other sites

I wrote a simply script to test but nothing

#include <GUIConstants.au3>

GUICreate("My GUI Progressbar",220,100, 100,200)
$progressbar1 = GUICtrlCreateProgress (10,10,200,20)
GUICtrlSetLimit(-1,5,0) 


$button = GUICtrlCreateButton ("Start",75,70,70,20)
GUISetState ()

$wait = 50; wait 20ms for next progressstep
$s = 0
do
$msg = GUIGetMsg()
If $msg = $button Then
    GUICtrlSetData ($progressbar1,0)
    
    GUICtrlSetData ($button,"Stop")
    For $i = $s To 100

        $m = GUIGetMsg ()
        
        If $m = -3 Then ExitLoop
        
        If $m = $button Then
          GUICtrlSetData ($button,"Next")
          $s = $i;save the current bar-position to $s
          ExitLoop
        Else
          GUICtrlSetData ($progressbar1,$i)
          Sleep($wait)
        EndIf
      
        if $i =5 then
            MsgBox(0,"help !","step 5  help !")
        endif
      
    Next
    
    if $i >100 then
        GUICtrlSetData ($button,"Start")
        $s = 0
    endif
EndIf
until $msg = $GUI_EVENT_CLOSE

Is this command correct : GUICtrlSetLimit(-1,5,0) ??

The progress bar should be at max with the value 5 !!

Share this post


Link to post
Share on other sites
GUICtrlSetLimit() if you read the parameters section (Max and Min) you notice that only work with List, Input, Edit and UpDown controls. Don't think it work with GuiCtrlCreateProgress().

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

I wrote a simply script to test but nothing

...

Is this command correct : GUICtrlSetLimit(-1,5,0) ??

The progress bar should be at max with the value 5 !!

I don't know that GuiCtrlSetLimit() does anything for a progress bar. I think your script has to do the math so the data is always = x/100.

:shocked:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

i had the solution x/100 or 100/ x for the step. But i recently see Koda_1.6.0.2 to generate gui and the code genrate by koda is

GUICtrlSetLimit(-1,5,0) .

A similar command exist in most language and i would try it.

Thank a lot :shocked:

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