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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:55:35+00:00 2026-06-05T01:55:35+00:00

I have several System.Threading.Timers on my form application with callbacks that update the UI…successfully

  • 0

I have several System.Threading.Timers on my form application with callbacks that update the UI…successfully – i.e. without throwing errors.

I had built these earlier, before I knew that UI should not be updated on any thread other than the UI thread.

Now I am confused as to why it does not throw cross-thread exceptions when I am updating UI on these separate threading.timer threads?

I will be changing these callbacks so that the UI updates are invoked on UI thread, but I am curious as to why this works.

Edit: My application is a WinForms Application.

  • 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-06-05T01:55:36+00:00Added an answer on June 5, 2026 at 1:55 am

    I will be changing these callbacks so that the UI updates are invoked on UI thread, but I am curious as to why this works.

    If this is Windows Forms, it works purely by luck. Updating a UI on a background thread doesn’t consistently work, but occasionally will not throw. In particular, if CheckForIllegalCrossThreadCalls is false, it will sometimes “work”, and never throw – though the behavior is often wrong. Some controls do not always check every property, so some items “work” even though they’re not always working correctly, as this typically introduces bugs that can be difficult to diagnose and correct later.

    On a side note: If this were WPF, you could change the value of a item bound to your UI, effectively updating your UI, on a background thread. The WPF binding system will automatically marshal this to the UI thread for you. It does not work to change part of a collection, however.

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

Sidebar

Related Questions

I have instantiated several System.Drawing.Icon Objects. Note that these are created at runtime and
I have several process in my system that need to communicate with each other.
I have several fairly large XML files that represent data exported from a system
I have a application in which i have several forms. In that forms, I
I have a program that will be running several system commands. The simplest way
I have a WPF application that spins off several threads. I have defined a
I have several old (pre-bundler / pre-rvm) Rails projects that use my system's gems.
I'm new to rails, and trying to develop a system that will have several
In C#, I have a System.IO.Ports.SerialPort component on my Windows form. I have several
Let's say we have system A comprising a MySQL database, with several tables. After

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.