首页 > 其他分享 >Cross-thread operation not valid: Control 'txtMessage' accessed from a thread other than t

Cross-thread operation not valid: Control 'txtMessage' accessed from a thread other than t

时间:2023-06-30 10:16:03浏览次数:46  
标签:Control thread created text Cross valid operation was

Winform TextBox

 

Cross-thread operation not valid: Control 'txtMessage' accessed from a thread other than the thread it was created on.

 

(330条消息) 解决Cross-thread operation not valid的问题_GuanXX的博客-CSDN博客

 

 

 private void safeSetText(string text) {
            if (this.InvokeRequired) {
                _SafeSetTextCall call = delegate(string s) {
                    this.textBox1.Text = s;
                };
 
                this.Invoke(call, text);
            }
            else
                this.textBox1.Text = text;
        }
 
        private delegate void _SafeSetTextCall(string text);

 

标签:Control,thread,created,text,Cross,valid,operation,was
From: https://www.cnblogs.com/hofmann/p/17515830.html

相关文章

  • Threading in C#, Joseph Albahari
    ThreadinginC#JosephAlbahariPART1Part2Part3Part4Part5GETTINGSTARTEDBasicSynchronizationUsingThreadsAdvancedThreadingParallelProgrammingLastupdated:2011-4-27Translations: Chinese | Czech | Persian | Russian | JapaneseDo......
  • Kafka核心总控制器Controller主要作用
    https://www.yisu.com/zixun/586556.html1简介1)更新集群元数据信息2)创建Topic3)删除Topic4)分区重分配5)preferredleader副本选举6)Topic分区扩展7)Broker加入集群8)Broker崩溃9)受控关闭10)controllerleader选举 2更新集群元数据信息Client可以从......
  • SAP FI -Company Basics&Define Business/Functional Area/Credit Control
    CompanyBasics-公司基础信息SAP中公司被定义为可以根据商业法律法规创建财务报表的最小单位。在SAPFI中,一家公司可以由多个代码组成,但它提供财务报表的单单位。所有公司代码必须使用相同的会计科目表和会计年度,但每个代码可以具有不同的本地货币。科目表列表由所有可用的科目表......
  • jmeter 解决线程组bzm-Concurrency Thread Group 安装的步骤
    1.首先 安装jmeter的插件,下载地址为放到lib/ext下,重启然后option下安装插件就Concurrency 就可以   ......
  • 一文搞懂什么是@Component和@Bean注解以及如何使用(包括与@Controller、@Service、@Re
      来源  https://blog.csdn.net/m0_51358164/article/details/126120731一文搞懂什么是@Component和@Bean注解以及如何使用......
  • Access control allow origin 简单请求和复杂请求
    错误信息:XMLHttpRequestcannotloadhttp://web.image.myqcloud.com/photos/v2/10008653/bhpocket/0/?sign=4FcLKd5B8…p4SkFVUEJtZ1omZT0xNDQ0NzExMDE5JnQ9MTQ0NDcwNzQxOSZyPTEzMDMyMDgzOTAmdT0wJmY9.No'Access-Control-Allow-Origin'headerispresentontherequ......
  • DevExpress GroupControl面板收缩展开
    1#regionGroupControl面板缩进展开绑定2privatevoidBindGroupControl(DevExpress.XtraEditors.GroupControlgroupControl)3{4DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptionsbuttonImageOptions1=newDevExpres......
  • Java之thread常用成员
    setName用于自定义线程的名字,方便我们调试定为问题;@TestpublicvoidsetNameTest(){Runnablerun=()->{System.out.println(Thread.currentThread().getName());};vart1=newThread(run);t1.start();......
  • thread sleep
    (27条消息)C++11多线程thread的休眠sleep_forchrono_chronosleep_tomorrow00hello的博客-CSDN博客 1usingnamespacestd;2voidppp()3{4for(inti=0;i<50;i++)5{6cout<<"hello"<<endl;7}89}10v......
  • Spring中什么时候用@Resource,@service,及Spring注解@Component、@Repository、@Servic
    参考资料http://crabboy.iteye.com/blog/339840文章正文<context:annotation-config/> <context:component-scanbase-package=”com.eric.spring”> component-scan标签默认情况下自动扫描指定路径下的包(含所有子包),将带有@Component、@Repository、@Service、@Controller标签......