{"id":2057,"date":"2023-04-01T21:21:56","date_gmt":"2023-04-01T13:21:56","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=2057"},"modified":"2023-04-07T06:05:16","modified_gmt":"2023-04-06T22:05:16","slug":"csharp-subthread-update-ui","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/04\/01\/csharp-subthread-update-ui\/","title":{"rendered":"CSharp \u5b50\u7ebf\u7a0b\u66f4\u65b0UI"},"content":{"rendered":"<p>\u95ee\u9898\uff1a<code>\u7ebf\u7a0b\u95f4\u64cd\u4f5c\u65e0\u6548: \u4ece\u4e0d\u662f\u521b\u5efa\u63a7\u4ef6\u201clistBox1\u201d\u7684\u7ebf\u7a0b\u8bbf\u95ee\u5b83<\/code><\/p>\n<p>\u5728\u591a\u7ebf\u7a0b\u7a0b\u5e8f\u4e2d\uff0c\u65b0\u521b\u5efa\u7684\u7ebf\u7a0b\u4e0d\u80fd\u8bbf\u95eeUI\u7ebf\u7a0b\u521b\u5efa\u7684\u7a97\u53e3\u63a7\u4ef6\uff0c\u5982\u679c\u9700\u8981\u8bbf\u95ee\u7a97\u53e3\u4e2d\u7684\u63a7\u4ef6\uff0c\u53ef\u4ee5\u5728\u7a97\u53e3\u6784\u9020\u51fd\u6570\u4e2d\u5c06<code>CheckForIllegalCrossThreadCalls<\/code>\u8bbe\u7f6e\u4e3a<code>false<\/code><\/p>\n<p><!-- more --><\/p>\n<pre><code class=\"language-csharp\">public Form1()\n{\n    InitializeComponent();\n    CheckForIllegalCrossThreadCalls = false;\n}<\/code><\/pre>\n<p>\u4e5f\u53ef\u4ee5\u9488\u5bf9\u67d0\u4e00\u63a7\u4ef6\u8fdb\u884c\u8bbe\u7f6e\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-csharp\">TextBox.CheckForIllegalCrossThreadCalls = false;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\uff1a\u7ebf\u7a0b\u95f4\u64cd\u4f5c\u65e0\u6548: \u4ece\u4e0d\u662f\u521b\u5efa\u63a7\u4ef6\u201clistBox1\u201d\u7684\u7ebf\u7a0b\u8bbf\u95ee\u5b83 \u5728\u591a\u7ebf\u7a0b\u7a0b\u5e8f\u4e2d\uff0c\u65b0\u521b\u5efa\u7684\u7ebf\u7a0b\u4e0d\u80fd\u8bbf\u95eeU [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[518],"tags":[],"class_list":["post-2057","post","type-post","status-publish","format-standard","hentry","category-csharp"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/2057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2057"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/2057\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}