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

  • Home
  • SEARCH
  • 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 898203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:00:26+00:00 2026-05-15T15:00:26+00:00

i have a problem whenever i Refresh the prograss bar i get the error

  • 0

i have a problem whenever i Refresh the prograss bar i get the error The calling thread cannot access this object because a different thread owns it
how can i remove it
shashank

     backgroundWorker12 = new BackgroundWorker();
     timer1.Enabled = true;
      //cancel any async processes running for the background worker
     //backgroundWorker1.CancelAsync();
     backgroundWorker12.DoWork += (s, args) =>
     {

         BackgroundWorker worker2 = s as BackgroundWorker;
         worker2.WorkerReportsProgress = true;

         float percentageDone = 20f;
         //check if the user status and update the password in xml
         CheckUseridPwd();


         //call the function to sync the wall chart data

         //call the function to sync event relate data

         percentageDone = 100f;
         ValidateLogin2(txtUserID.Text.Trim(), txtPassword.Password.Trim(), -1); 
         worker2.ReportProgress((int)percentageDone);

     };`
  • 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-15T15:00:27+00:00Added an answer on May 15, 2026 at 3:00 pm

    This bit looks like it’s using UI controls from the wrong thread:

     ValidateLogin2(txtUserID.Text.Trim(), txtPassword.Password.Trim(), -1);
    

    I suggest you capture the user and password in local string variables above the code which adds the event handler – you can use those captured variables within your delegate. That way everything should be on the right thread:

    backgroundWorker12 = new BackgroundWorker();
    timer1.Enabled = true;
    
    string user = txtUserID.Text.Trim();
    string password = txtPassword.Password.Trim();
    backgroundWorker12.DoWork += (s, args) =>
    {
        // ... same code as before up to here
        ValidateLogin2(user, password, -1); 
        worker2.ReportProgress((int)percentageDone);
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with using dequeueReusableCellWithIdentifier method. Whenever I use this one, one cell
I have this weird problem whenever I roll my mouse over each of the
I have a problem with using the prefix, seems like whenever I use the
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I have a problem where whenever I debug (F5) the Compact Framework app we're
I have a problem, that whenever i try to create java process from shell
The problem: whenever, if i have the single '=' the variable will show up
I have a problem with my code that plays a video file. Whenever I
i have a program that shows a splash screen.But the problem is whenever i

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.