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 7878825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:46:08+00:00 2026-06-03T03:46:08+00:00

I have a pretty long running process which now freezes my application for a

  • 0

I have a pretty long running process which now freezes my application for a while.

How can i wrap this process in a backgroundworker and provide the user with a status.

I know that ideally the process itself would have to report its progress, but i dont think i can build that in. It’s not that i cannot change the code in that process, but i dont want to change it too much.

I would be nice if i could start the process in a backgroundworker so that my app stays responsive. Now this i can do. But the question is, is there an easy way to have some progressbar doing something to indicate that the process is still running?

private void worker_DoWork(object sender, DoWorkEventArgs e)
{
    StartLongRunningProcess();
}

My code is now like the above, and i was wondering how to wrap the process in some way that i can update a progressbar? Or is there an easy way to get some more information from this process without completely changing it’s code? Inside that long running process there is a modified row counter running, but it only return a value when it’s finished.

I know how the backgroundworker and it’s ReportProgress options work, but the problem is that the process just runs and doesn’t provide any feedback while running.

  • 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-03T03:46:09+00:00Added an answer on June 3, 2026 at 3:46 am

    If you set the WorkerReportsProgress property to true you can then use the ProgressChanged event.

    BackgroundWorker bw = new BackgroundWorker{WorkerReportsProgress = true}
    bw.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged);
    
    private void bw_ProgressChanged(object sender, ProgressChangedEventArgs e)
    {
       var percent = e.ProgressPercentage;
       //update progress bar here
    }
    

    Then in your do work you can report the progress.

    private void bw_DoWork(object sender, DoWorkEventArgs e)
    {   
       BackgroundWorker worker = sender as BackgroundWorker;    
       e.Result = StartLongRunningProcess(worker);
    }
    
    public void StartLongRunningProcess(BackgroundWorker worker)
    {
       worker.ReportProgress(percentComplete);
    }
    

    You can find the full example here

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

Sidebar

Related Questions

I have a pretty long running job, which runs for several minutes and then
I have a list of user identifiers which are pretty long. The identifiers may
I have a text file that is pretty long. Any easy way to undo
I have looped data from mysql, and it's a pretty long list. What's the
I have pretty much finished my first working Symbian application, but in my hastened
I have a web service that's pretty simple; something like this: public class LeadService
I have a recursive immutable data structure in ocaml which can be simplified to
Is there any way (apart form actual perfomance measurements which can be pretty hard
I have a C++ application cross-compiled for Linux running on an ARM CortexA9 processor
We have an asynchronous task that performs a potentially long-running calculation for an object.

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.