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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:24:31+00:00 2026-05-24T07:24:31+00:00

I am using background worker to do a long process on some files. I

  • 0

I am using background worker to do a long process on some files. I take the address of a directory from textBox1 and the address of a file that is used for the processing function from textBox2. I also have a ComboBox. Based on the selected value of the ComboBox the program chooses a different function through a simple switch case.

Now the problem is that I can not access the values of these textBoxes and the ComboBox in the BackGroundWorker_DoWork. I of course get the exception of accessing a control from a thread it wasn’t created on. I have searched a lot about delegates and all that. The examples I have seen so far are all about assigning a text to the textBox inside the program. While what I want to do is to read the text that the user has inserted into the textBox. Since I’m not quite familiar with the concept of delegates, I want to know how I can read and use the Texts of textBoxes and the ComboBox and process them in the BackGroundWorker?

Sorry I cannot post the code here due to security policies.

/MoNoo

  • 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-24T07:24:32+00:00Added an answer on May 24, 2026 at 7:24 am

    You don’t say if this is WinForms, WPF or Silverlight, but in WPF you would do this using the Dispatcher property of the combobox, something like this:

        string theText;
    
        myComboBox.Dispatcher.Invoke( DispatcherPriority.Normal,
                new Action( delegate()
                {
                    theText = myComboBox.Text;
                }
            ));
    

    That will marshal the call onto the main thread and back again.

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

Sidebar

Related Questions

C# 2005 I am using a background worker to process some login information. However,
My C# application is such that a background worker is being used to wait
I've got a background worker on a form and I've written some long running
I'm using a background worker in order to get data from a database. My
C# 2008 SP1 I am using the background worker If one of the conditions
Can I run a PHP CGI script as a background process using exec() ?
I am using the Background worker thread in a Silverlight 4 application. In the
I'm using gearman to distribute long running tasks across multiple worker servers. For one
We have an ASP.NET application that queues some of its long-running operations (generating reports,
I am using a very component heavy form that takes long time to set

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.