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

  • SEARCH
  • Home
  • 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 8058349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:19:38+00:00 2026-06-05T09:19:38+00:00

I was hoping for some help with my backgroundworker as I just cant get

  • 0

I was hoping for some help with my backgroundworker as I just cant get it to work. Basically I have a backgroundworker which does a few tasks but I’m trying to implement a progress bar and a label. I’m going to set the maximum value of the progress bar to 10 and then have it updating as I move with each task, also I’m thinking of a label with the progress bar which will display the progress ie

Pb value = 2
20% completed

Pb value = 6
60% completed

and so on.

So far I have this for the coding.

Update* Thanks lars fr your help.

So just a quick question would the do work event be like so?

Private Sub BGWorker_DoWork(ByVal sender As Object, _
                            ByVal e As DoWorkEventArgs) _
                            Handles BGWorker.DoWork
  For i as Integer = 1 to 2
    'My task code 1
    BGWorker.ReportProgress(i)
  Next

 For i as Integer = 3 to 4
    'My task code 2
    BGWorker.ReportProgress(i)
  Next

 For i as Integer = 5 to 6
    'My task code 3
    BGWorker.ReportProgress(i)
  Next

 For i as Integer = 7 to 8
    'My task code 4
    BGWorker.ReportProgress(i)
  Next

 For i as Integer = 9 to 10
    'My task code 5
    BGWorker.ReportProgress(i)
  Next
End Sub
  • 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-05T09:19:40+00:00Added an answer on June 5, 2026 at 9:19 am

    Instead of trying to set the progress bar value in DoWork (which isn’t running on the UI thread), you need to have the BackGroundWorker “report” it’s progress:

    Private Sub BGWorker_DoWork(ByVal sender As Object, _
                                ByVal e As DoWorkEventArgs) _
                                Handles BGWorker.DoWork
      For i as Integer = 1 to 10
        BGWorker.ReportProgress(i)
      Next
    End Sub
    

    Then in your ProgressChanged event, you can set the value of the Progress bar:

    Private Sub BGWorker_ProgressChanged(ByVal sender As Object, _
                                         ByVal e As ProgressChangedEventArgs) _
                                         Handles BGWorker.ProgressChanged
      Me.Pb1.Value = e.ProgressPercentage
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was hoping to get some help with my SQL Server script. Basically, I
I have a small problem that I am hoping to get some help with.
hoping to get some help here. I have locations on a database that I
I'm hoping people have some ideas to help solve this problem. I am developing
I was hoping to get some advice on what to do. I have a
I am hoping to get some help on this issue. Some users on IE
I'm hoping to get some help with this weird problem. We're running the Jacorb
I struggle with JSON and jQuery so I'm hoping to get some help figuring
Hi guys I was hoping from some help here, please. I have a INSERT
Hello all I was hoping to get some help with inported this class to

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.