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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:41:36+00:00 2026-05-11T11:41:36+00:00

OK, please disregard what has gone before. I’m not getting the errors anymore, so

  • 0

OK, please disregard what has gone before. I’m not getting the errors anymore, so it seems my problem is with getting a Chart to update when I change the values to which the Chart is data bound.

//Disregard below here

Hi all. I have a WinForms application that has a panel, panel1. A background thread creates some other controls that then get added to panel1 like so

panel1.Controls.AddRange(myArrayOfControls); 

This works great and I can see my controls get added. But, when new data comes in on another thread, I update values in the controls’ parent objects and then need to Refresh() to get the display to update with the new values. Calling Refresh() in either context, the thread where the data comes in or the objects that receive the updated data causes an InvalidOperation exception because Invoke is required. I’ve tried using Invoke in my model objects and also the thread where the data is incoming and can’t seem to shake the error.

If anyone has some guidance I’d greatly appreciate it.

UPDATE: Here’s a little more info. I didn’t think it would require it, but I was wrong. 🙂

I have an object class MyObject. This MyObject class gets created in a thread called topologyThread. Data comes in on dataThread. Instances of MyObject have a Panel instance variable and the Panel has child Controls including two Charts from the System.Windows.Forms.DataVisualization.Charting namespace. So, as data comes in on dataThread, I update the respective data values in the MyObject objects and then need to refresh the Charts to show the updated data.

I do know the data is processing fine. In my MyObject class, I’m logging the new values to Console in the setter for the property and see the new values show up.

  • 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. 2026-05-11T11:41:36+00:00Added an answer on May 11, 2026 at 11:41 am

    You must do both operations (refresh and updating of control’s parent object) from the main UI thread. If you are modifying a control from a background thread and not getting an exception that is bad luck because it is definitely an error.

    The best way to do this is to use

    theControl.Invoke(new MethodInvoker(MyUpdateMethod)); 

    If you have a sample of how the update is done, we can give a better sample on how to properly call it from the background thread.

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

Sidebar

Ask A Question

Stats

  • Questions 112k
  • Answers 112k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The only 'documentation' that I found was a unit test… May 11, 2026 at 9:53 pm
  • Editorial Team
    Editorial Team added an answer If you want a safe way to introduce pre- and… May 11, 2026 at 9:53 pm
  • Editorial Team
    Editorial Team added an answer You can use a TableLayoutPanel, with 3 columns each of… May 11, 2026 at 9:53 pm

Related Questions

OK, please disregard what has gone before. I'm not getting the errors anymore, so
I am currently trying to code my own JS drag and drop script (out
Ok, I'm an MVC newbie coming from a webforms background, so please excuse any
Ok, i've been trying to solve this for about 2 hours now... Please advise:
OK, I am not sure if the title it completely accurate, open to suggestions!

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.