Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9100535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:53:26+00:00 2026-06-17T00:53:26+00:00

Possible Duplicate: .NET progressbar not updating I built a progress bar class that shows

  • 0

Possible Duplicate:
.NET progressbar not updating

I built a progress bar class that shows the progress in my for loops. Here’s the code for the progress bar class:

Public Class frmProgress
Private Sub frmProgress_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    progressBar.Minimum = 0
End Sub

Public Sub ProgressBarSetup(ByRef Maximum As Integer, ByRef Title As String)
    progressBar.Maximum = Maximum
    progressBar.Value = 0
    Me.Text = Title
    Me.Show()
End Sub

Public Sub IncProg()
    progressBar.Value += 1
    Application.DoEvents()

    If progressBar.Value = progressBar.Maximum Then
        Me.Close()
    End If
End Sub
End Class

Here’s how I would use it in a for loop:

Dim pb As New ProgressBar
pb.ProgressBarSetup(5000, "Test")

For i As Integer = 0 To 5000 - 1
      pb.IncProg()
Next

The issue is a visual problem. It completes up to 70-85% of the complete progress bar and then closes. On closure, the progress bar value and maximum values are equal, yet the bar is only filled to about three quarters of it’s length.

I tried using progressBar.Refresh() instead of Application.DoEvents() but it slows down the progress by a lot – and still gives me the same result.

Is there any other ways to achieve a better visually appealing progress bar?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T00:53:27+00:00Added an answer on June 17, 2026 at 12:53 am

    Seeing this effect is normal on Windows 7. Problem is when you set a value to X, it slides to this position over the next 0.5-1 second. So if your action is happening fast, you will only see it full at 50-80%. Solution is to set first to a higher value and then decrement to the one you want. Something like this:

    progressBar.Value += 2
    progressBar.Value -= 1
    

    And also don’t forget to increase maximum temporarily, or you may get an exception, for example, when incrementing from 4999 to 5000 (you cannot set to 5001).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Protect .NET code from reverse engineering? we just develop a application with
Possible Duplicate: Yield In VB.NET In C#, when writing a function that returns an
Possible Duplicate: .NET Controls: Why aren’t all calls thread-safe? This question is not about
Possible Duplicate: .NET: Determine the type of this class in its static method How
Possible Duplicate: .NET How to check if path is a file and not a
Possible Duplicate: VB.NET Function Return If I have a function that returns a boolean,
Possible Duplicate: javax.net.ssl.SSLException: Not trusted server certificate I am trying to connect to server
Possible Duplicate: Why does .NET use banker's rounding as default? Here is a sample
Possible Duplicate: .NET code to send ZPL to Zebra printers My company has a
Possible Duplicate: Protect .NET code from reverse engineering? I want to make my software

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.