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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:08:17+00:00 2026-06-04T18:08:17+00:00

Is there something like this on BackgroundWorker ? when a function ends in DoWork

  • 0

Is there something like this on BackgroundWorker? when a function ends in DoWork callback, I get it on ProgressChanged a value of this progress according with the functions are ending.

Code example:

bw.DoWork += (a,b) => {
  foo();
  baa();
  if(..) else {  }
};

when each statement ends, I get it on

  bw.ProgressChanged += (o, e) => {
                   MessageBox.Show(e.ProgressPercentage);
   };

I have three stataments, it should print three Message.Show(): 33,66,100

33% => foo() was executed.

66% => baa() was executed.

100% => if(..) else { } the last statement was executed, done.

I could to call .ReportProgress() method inside each function/statement that run on DoWork callback event,but depending of statements numbers,this can be inviable.

I hope this is clear. And my apologies for my bad english.

  • 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-04T18:08:19+00:00Added an answer on June 4, 2026 at 6:08 pm

    If I’m understanding your question; the answer is ‘No, there is no way for the backgroundworker to automatically report it’s progress’.

    You’ll have to explicitly make calls to .ReportProgress()

    bw.DoWork += (a,b) => {
      foo();
      worker.ReportProgress(33);
      baa();
      worker.ReportProgress(66);
      if(..) else {  }
    };
    

    You could get clever and do something like build a queue of Actions, call each action and call ReportProgress after each, if you are really dealing with a large number of method calls in your DoWork body.

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

Sidebar

Related Questions

Is there a built-in function for this in Python 2.6? Something like: clamp(myValue, min,
Is there any way to get the previous URL in JavaScript? Something like this:
I need a map function. Is there something like this in Java already? (For
Came across something like this today, and was wondering if there was an equivalent
Is there a way in java to do something like this: void fnc(void Reference_to_other_func());
Is there a better way to do something like this? This is fine but
There is a python file named BasePlat.py which contain something like this: class BasePlatform(SimObj):
I have code which needs to do something like this There is a list
Is there a way to choose dynamicaly an operator do something like this: var
Why is there no list-style infinite type error when I define something like this

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.