2017-02-27 46 views
-1

“System.InvalidOperationException”类型的未处理的异常出现在System.Windows.Forms.dll中有麻烦与连接到电报机器人用C#

其他信息:跨线程操作无效:控制“LABEL1 '从其创建线程以外的线程访问。

enter image description here

+1

显示一些代码,所以我们会知道如何帮助你 –

+0

[我怎么问** **好问题?(http://stackoverflow.com/help/how-问题) –

+0

[Cross-thread operation not valid:Control from a visit to a thread that's not that it is created on on线程](http://stackoverflow.com/questions/142003/cross-thread-operation-not -allen-control-from-a-thread-other-than-the) –

回答

0

如果你需要使用invoke方法做更新的GUI线程(主线程)在控制一个WinForms应用程序。您试图从后台线程更新控件。

尝试像label1.Invoke(() =>{ ... });