09 2013 档案

摘要:一个简单的Form, 按钮btnTest是enabled=false。在btnEnable的Click事件中 创建线程,在线程中尝试设置btnTest.Enabled = true; 发生异常:线程间操作无效: 从不是创建控件“btnTest”的线程访问它。代码如下: 1 using System; 2 using System.Threading; 3 using System.Windows.Forms; 4 5 namespace TestingUIThread 6 { 7 publicpartialclass Form1 : Form 8 { 9 Threa... 阅读全文
posted @ 2013-09-01 20:46 佳序 阅读(227) 评论(0) 推荐(0)