未处理 System.InvalidOperationException
Message="线程间操作无效: 从不是创建控件“label1”的线程访问它。"
Source="System.Windows.Forms"
StackTrace:
在 System.Windows.Forms.Control.get_Handle()
在 System.Windows.Forms.Control.set_WindowText(String value)
在 System.Windows.Forms.Control.set_Text(String value)
在 System.Windows.Forms.Label.set_Text(String value)
在 soc.Form1.BeginListen() 位置 E:\zhouquanwork\soc\soc\Form1.cs:行号 46
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
Message="线程间操作无效: 从不是创建控件“label1”的线程访问它。"
Source="System.Windows.Forms"
StackTrace:
在 System.Windows.Forms.Control.get_Handle()
在 System.Windows.Forms.Control.set_WindowText(String value)
在 System.Windows.Forms.Control.set_Text(String value)
在 System.Windows.Forms.Label.set_Text(String value)
在 soc.Form1.BeginListen() 位置 E:\zhouquanwork\soc\soc\Form1.cs:行号 46
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
解决方案 »
- 有form1,和form2两个窗体。点击form1上的button1,显示form2。再点击form1上的button1,隐藏form2!怎么实现?
- 求指点
- C# Winform Checkbox如何加入只讀屬性
- 在C#中开发怎样按拼音查找到
- 曾经研究过Java的朋友请进来帮我解决一个简单的C#问题
- 我想把一个C#写的程序嵌入在C++程序里面,怎么做。
- 如何将Winform下的DataGrid绑定到抽象的实体集上?
- 读取文本文档;直接以文本(txt)格式,浏览;
- 如何全局获得鼠标移动,点击之类的消息
- 急!急!急!急!急!关于在C/S构架下对SQL数据库的操作!
- 求图片切换的效果
- 能不能做出像csdn这样的效果!
public void setT(string t)
{
textBox1.Text = t;
} tt = new setText(setT);
textBox1.Invoke(tt, new object[] { s });