标题:c#桌面编程遇到的问题
只看楼主
fiiwiner
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2008-10-13
 问题点数:0 回复次数:3 
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是开始按钮

高手帮帮忙,谢谢~~
搜索更多相关主题的帖子: 文件下载 
2008-10-27 17:18
风居住的街道
Rank: 1
等 级:新手上路
帖 子:374
专家分:0
注 册:2008-10-24
得分:0 
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.

XXX.dll中未捕获类型为“xxxx”的异常。
附加信息:线程间操作不可用:空间被非创建线程访问。

就是说,你用另一个不是创建了按钮的线程来访问了这个按钮……
2008-10-27 19:44
fiiwiner
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2008-10-13
得分:0 
但是我好像已经创建线程了啊..那该怎么办?
2008-10-30 21:46
luceker
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2008-5-5
得分:0 
用BackgroundWorker?
查查msdn
2008-10-30 21:50



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-240921-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.458044 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved