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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:58:23+00:00 2026-05-13T23:58:23+00:00

The Scenario I have a windows forms application containing a MAINFORM with a listbox

  • 0

The Scenario

I have a windows forms application containing a MAINFORM with a listbox on it. The MAINFORM also has a THREAD POOL that creates new threads and fires them off to do lots of different bits of processing. Whilst each of these different worker threads is doing its job, I want to report this progress back to my MAINFORM, however, I can’t because it requires Cross-Thread communication.

Progress

So far all of the tutorials etc. that I have seen relating to this topic involve custom(ish) threading implementations, whereas I literally have a fairly basic(ish) standard THREAD POOL implementation. Since I don’t want to really modify any of my code (since the application runs like a beast with no quarms) – I’m after some advice as to how I can go about doing this cross-thread communication. ALTERNATIVELY – How to implement a different "LOGTOSCREEN" method altogether (obviously still bearing in mind the cross-thread communication thing).

WARNING:

I use this website at work, where we are locked down to IE6 only, and the javascript thus fails, meaning I cannot click accept on any answers during work, and thus my acceptance rate is low. I can’t do anything about it I’m afraid, sorry.

EDIT:

I DO NOT HAVE INSTALL RIGHTS ON MY COMPUTER AT WORK.
I do have firefox but the proxy at work fails when using this site on firefox.
And no, funnily enough, I don’t have the internet at home, I literally just moved to this city and the flat is a new build, so the address hasn’t been registered with the post office, and thus the phone company cannot find the address on their system till they send a surveyor out, smarty pants.

FURTHER EDIT:

I DO NOT WANT TO CHANGE MY THREADING IMPLEMENTATION. AT ALL! – Accept to enable cross-thread communication….why would a backgroundworker help here!?

CODE RELATED EDIT:

Does it make a difference that when my THREAD POOL executes the new threads, it creates a new instance of a class and calls the entire thing on that new thread……..i.e. your code example doesn’t quite fit….i think?

  • 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-13T23:58:23+00:00Added an answer on May 13, 2026 at 11:58 pm

    Use the BackgroundWorker class in .NET and use the ProgressChanged and RunWorkerCompleted events to communicate back to your UI thread

    Edit:

    Sounds like you don’t like BackgroundWorker, or just don’t want to refactor. In that case, you have to check the InvokeRequired property on your form or one of your controls and if it is true, then you have to call Control.Invoke to force your UI update logic to occur on your main thread.

    here is an example:

    private void MyThreadFunction()
    {
        if (!InvokeRequired)
        {
            myLabel.Text = "You pushed the button!";
        }
        else
        {
            Invoke(new ThreadStart(MyThreadFunction));
        }
    }
    

    You can use any delegate type to pass to Invoke, because it takes optional parameters that can be passed to your delegate when it is invoked on the main thread.

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

Sidebar

Related Questions

Scenario I have a C# windows forms application that has a number of processes.
Scenario I have a Windows Forms Application. Inside the main form there is a
Scenario I have a windows forms application. I want to use two different WCF
I have developed a .Net 3.5 windows forms application. I also want to design
My scenario: Windows Forms Application with a base master (mdi) form. An Interface that
Scenario I have a windows service written in C# that performs some processing based
I have the following scenario: - 64bit Windows Server 2008. - 32bit .NET application
we have a .net windows forms application and for years we have been using
Think at this scenario: I have a c# windows form application. This application was
I have an application that is using Windows Authentication and a SqlRoleProvider for user

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.