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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:59:44+00:00 2026-05-30T02:59:44+00:00

I’ve run into an issue that I can’t seem to figure out the solution

  • 0

I’ve run into an issue that I can’t seem to figure out the solution to, I’ve read several answers and have gotten as far as knowing that I need a BackgroundWorker Thread to make this solution work, but I’m still running into a bit of an issue.

I have a second form that is a small size and set to center on screen with a ProgressBar Style set to Marquee, there is nothing else on this second form as it is meant to emulate a loading bar.

In my data intensive section of the code, on the main form, where it grabs and parses data from a database I have it written like this:

 GetData()
 {
      bwLoading.RunWorkerAsync();
      //Runs all the processing
      bwLoading.CancelAsync();
 }

The background worker is defined as such below, also on the main form.

 private void bwLoading_DoWork(object sender, DoWorkEventArgs e)
    {
        BackgroundWorker worker = sender as BackgroundWorker;
        frmLoading lb = new frmLoading();
        bool running = true;
        while (running)
        {
            if ((worker.CancellationPending == true))
            {
                lb.Close();
                running = false;
            }
            else
            {
                lb.Show();
            }
        }

    }

The problem I have run into is that with this method it shows the Loading form that contains the progress bar does show up when the data starts getting gathered and process and does disappear when the data load is complete, but the window is empty like it’s trying to load, but it doesn’t. I can’t seem to figure out why this isn’t working.

Isn’t the background worker creating a separate thread for the Loading form to use? Or is there something else that I’m missing from my reading?

  • 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-05-30T02:59:45+00:00Added an answer on May 30, 2026 at 2:59 am

    You have to actually report the progress of your background operation using ReportProgress(). This requires you knowing how much percent of your work you have completed.

    If you do not report progress, the progress bar will always remain at 0% until your background operation is completed, and disappear afterwards – which is what you are observing.

    Edit:

    In light of your comment – you are using a marquee style progress bar – I think the problem is here:

     GetData()
     {
          bwLoading.RunWorkerAsync();
          //Runs all the processing
          bwLoading.CancelAsync();
     }
    

    I suspect you execute the GetData() method from the UI thread – that means the UI thread is blocked and the progress bar cannot be updated. Move all your processing to the bwLoading_DoWork method so it is executed on a separate thread and not the UI thread – then your progress bar should get updated. Also remove the bwLoading.CancelAsync() call – this would be used only for cancellation.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace

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.