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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:30:33+00:00 2026-06-13T01:30:33+00:00

I am creating some files from xml data in the background using Task.Factory.StartNew(() =>

  • 0

I am creating some files from xml data in the background using

Task.Factory.StartNew(() => xmlconvert(xx, yy));

Now, the question is how to show the progress of this method using a StatusStrip control with some message and the progress or at least just a scrolling animation for the progress. I don’t just have any idea how would it work.

Update:
First of all, this method ‘xmlconvert(xx, yy)’ has four different forms depends on the condition user selects at runtime.
In the main form of my application user can select from different conditions to process on the data. Then finally when user click on the Button ‘Create’ all these conditions are being checked and a suitable method will be called within that button click event. I need to show the progress of this method which is being invoked at runtime.

private void btnCreateRelease_Click(object sender, EventArgs e)
{
      // Checks set of conditions

      if(cond 1)
      {
          xmlconvert_1();
      }
      else if (cond2)
      {
          xmlconvert_2();
      }
      else if (cond3)
      {
          xmlconvert_3();
      }
      else if (cond4)
      {
          xmlconvert_4();
      }
}

I want to show progress of one of these methods which will be invoked at runtime depends on the condition.

Thanks a lot.

  • 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-13T01:30:34+00:00Added an answer on June 13, 2026 at 1:30 am

    You can use the BackgroundWorker for this, and it’s pretty simple, too. Here’s a sample to get you going:

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
    
            backgroundWorker1.WorkerReportsProgress = true;
            backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
            backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
        }
    
        void Form1_Shown(object sender, EventArgs e)
        {
            backgroundWorker1.RunWorkerAsync();
        }
    
        void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            // Do your work in here.
            xmlconvert(xx, yy);
    
            for (int i = 0; i <= 100; i++)
            {
                backgroundWorker1.ReportProgress(i);
                System.Threading.Thread.Sleep(100);
            }
        }
    
        void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            progressBar1.Value = e.ProgressPercentage;
        }
    }
    

    And here’s the link to the documentation.

    To get it to work in your scenario, I would suggest you add a Progress bar to your StatusStrip control and update it from within the backgroundWorker1_ProgressChanged event.

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

Sidebar

Related Questions

I'm creating an asp.net app with just some lite data access from xml files.
working on creating an XML file with some data using Python. I am trying
So, I am creating a bunch of temporary files from backing up some google
I'm currently converting some legacy code to create PDF files using iTextSharp. We're creating
I am creating a XML file from a database using PHP.. I am following
Following on from my recent question regarding parsing XML files in Java I have
I am using the following code to retrieve data from the xml file. It
In my app am creating some files and storing them in cache dir .
I am creating an application which produces some files/directories in my WebContent folder and
I'm creating a simple file walker to list some files and need to omit

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.