并行遍历control

protected void ClearTextBox()
{
Parallel.ForEach<Control>(this.Controls.Cast<Control>(), c =>
{
if (c is TextBox)
{
TextBox temp = (TextBox)c;
temp.Text = null;
}
});
}

posted @ 2014-01-22 19:24  天藐水瓶  阅读(122)  评论(0编辑  收藏  举报