Results 1 to 3 of 3

Thread: Progress meter step?

  1. #1

    Thread Starter
    Hyperactive Member Art W.'s Avatar
    Join Date
    Apr 2002
    Location
    In My Own Little World, But that’s OK because they know me there!
    Posts
    271

    Progress meter step?

    Hello Everyone:

    My progress meter finishes too soon. I want my meter to end on the last loop. But instead it finishes on the first step of the loop instead of the last loop. I know I am missing something very simple, but I have no idea as to what it is?

    Code:
     Do Until Num1 = 0
                If Num1 <= 0 Then Exit Do
    
                Do Until x = 0
                    If x <= 0 Then Exit Do
    
                    pBar1.Visible = True
                    pBar1.Minimum = 1
                    pBar1.Maximum = 2
                    pBar1.Value = 1
                    pBar1.Step = 1
                    pBar1.PerformStep()
    
                    MessageBox.Show("The meter has " & x & " Times, And the program has looped " & Num1 & " Times")
    
                    x -= 1
    
                    Num1 -= 1
                    Num2 += 1
    
                Loop
            Loop

    Thanks

    Art W.
    SLEEP: A Totally Inadequate Substation For Caffeine!

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Progress meter step?

    'value = 0
    pBar1.Value = 1 'value = 1
    pBar1.Step = 1
    pBar1.PerformStep() 'value += 1
    'value now = 2

  3. #3
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Progress meter step?

    put Num1 -= 1
    after the first loop.
    Edit and also x -=1 on the inside loop will find x as zero on the next num1 loop.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width