Results 1 to 4 of 4

Thread: progressbar math

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2021
    Posts
    69

    progressbar math

    I am trying to process files in a folder.

    I use a progressbar to show the progress.

    i = number of documents found

    Code:
                   ToolStripProgressBar1.Maximum = i
                    ToolStripProgressBar1.Step = i / 100
                    If ToolStripProgressBar1.Step < 1 Then
                        ToolStripProgressBar1.Step = 1
                    End If
    I noticed that when ToolStripProgressBar1.Step = i / 100 is less then 1 the progressbar doesn't update
    So I try to make the step = 1 but I don't think that will work.

    Anyone good in math?

  2. #2
    Frenzied Member
    Join Date
    Nov 2017
    Posts
    1,646

    Re: progressbar math

    Code:
    ToolStripProgressBar1.Step = i / 100
    That makes no sense. You are setting the Maximum value to i, so just set the Step value to 1, and then call

    Code:
    ToolStripProgressBar1.PerformStep
    after each file is processed.


    Suggested reading:

    https://docs.microsoft.com/en-us/dot...r?view=net-5.0

    Including relevant Methods and Properties.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2021
    Posts
    69

    Re: progressbar math

    Of course

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,172

    Re: progressbar math

    If you issue is resolved, please use the Thread Tools menu to mark the thread Resolved. That way, we can see that you don't need any more help without opening and read the whole thread.

Tags for this Thread

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