C#中Winform線程操作界面控件

2010-08-28 10:50:27來(lái)源:西部e網(wǎng)作者:

控件只能夠?yàn)橹骶程 所有 所以只能夠
如下實(shí)現(xiàn)

System.Threading.Thread myThread1 ;
delegate void AddNodeDelegate();

myThread1 = new System.Threading.Thread(new System.Threading.ThreadStart(threadone));

void threadone()
{
this.tree.Invoke(new AddNodeDelegate(test);
}


private void test()
{
TreeNode node2 = tree.Nodes.Add("計(jì)算機(jī)");
olecon.Open();
treefull(node2);
olecon.Close();
}
private void treefull(TreeNode treeNode)
{//遞歸過(guò)程
}

這樣就OK了 

關(guān)鍵詞:C#