{"id":13685,"date":"2017-08-08T19:18:00","date_gmt":"2017-08-08T19:18:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/?p=13685"},"modified":"2019-02-14T20:23:32","modified_gmt":"2019-02-15T03:23:32","slug":"updating-windows-form-ui-elements-from-another-thread","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/updating-windows-form-ui-elements-from-another-thread\/","title":{"rendered":"Updating Windows Form UI elements from another thread"},"content":{"rendered":"<p>This post is from App Dev Manager, <a href=\"https:\/\/www.linkedin.com\/in\/omer-amin\/\">Omer Amin<\/a> who covers how to update Windows Form UI elements using worker threads.<\/p>\n<hr>\n<p><a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/ms171728(v=vs.110).aspx\"><img decoding=\"async\" width=\"640\" height=\"439\" align=\"right\" style=\"margin: 0px 0px 0px 10px;float: right\" alt=\"cross-thread-exception\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/Cross-thread-Exception.png\"><\/a>In a typical Windows Forms .NET application, the UI elements are created and updated by the main thread. This thread is also responsible for processing Windows messages. For this reason, it is recommended to keep message processing short and simple. Long running operations performed on this thread will cause incoming Windows messages to queue up. If messages don&#8217;t get processed in a timely manner, the application will appear hung to the user and provide a poor user experience.<\/p>\n<p><a href=\"https:\/\/blogs.msdn.microsoft.com\/make_it_better\/2017\/05\/15\/updating-windows-form-ui-elements-from-another-thread\/\">Continue on Omer\u2019s personal blog<\/a>.<\/p>\n<p><br><\/p>\n<p><br><\/p>\n<hr>\n<p><a href=\"https:\/\/blogs.msdn.com\/b\/premier_developer\/archive\/2014\/09\/15\/welcome.aspx\"><strong>Premier Support for Developers<\/strong><\/a> provides strategic technology guidance, critical support coverage, and a range of essential services to help teams optimize development lifecycles and improve software quality.&nbsp; Contact your Application Development Manager (ADM) or <a href=\"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/contact-us\/\">email us<\/a><b><\/b> to learn more about what we can do for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is from App Dev Manager, Omer Amin who covers how to update Windows Form UI elements using worker threads. In a typical Windows Forms .NET application, the UI elements are created and updated by the main thread. This thread is also responsible for processing Windows messages. For this reason, it is recommended to [&hellip;]<\/p>\n","protected":false},"author":582,"featured_media":37840,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[80],"tags":[106,3],"class_list":["post-13685","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net","tag-net","tag-team"],"acf":[],"blog_post_summary":"<p>This post is from App Dev Manager, Omer Amin who covers how to update Windows Form UI elements using worker threads. In a typical Windows Forms .NET application, the UI elements are created and updated by the main thread. This thread is also responsible for processing Windows messages. For this reason, it is recommended to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/13685","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=13685"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/13685\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/37840"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=13685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=13685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=13685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}