日期:2014-05-18  浏览次数:20938 次

c#桌面编程遇到的问题
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll

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

运行的时候出现上面的错误提示。
说明:程序的功能是实现文件下载
btn_Start是开始按钮

请问这是什么原因,该怎么解决?

高手帮帮忙,谢谢~~

------解决方案--------------------
肯定代码那里写的有问题
------解决方案--------------------
跨线程操作要用 Control.Invoke 不能直接调用