跨线程访问UI

线程间的安全检查导致其他线程不能调用UI控件的解决方法:

private delegate void csvDelegate(string instr);

private void csvDel(string strLine)
{
    string[] aryLine = strLine.Split(',');
    dataGridView1.Rows.Add(aryLine);
    dataGridView1.Refresh();
}
————————————————————————
// dataGridView1 有三列
string strLine = "0.1668056,-0.569,-0.598";
this.BeginInvoke(new csvDelegate(csvDel), strLine);  


winform线程间操作UI的五种方法:http://www.cnblogs.com/huhu583/p/5520291.html#undefined

我的这个算是第六个方法吗?O(∩_∩)O哈哈~

原文地址:https://www.cnblogs.com/shelly0307/p/7553027.html