创建新的时Thread
,如何传递一个有TextBoxes
参数的方法??
private void waits(TextBox t1 ,TextBox t2)
{
t1.BackColor = Color.Red;
t2.BackColor = Color.Red;
}
Thread n1=new Thread(waits)
创建新的时Thread
,如何传递一个有TextBoxes
参数的方法??
private void waits(TextBox t1 ,TextBox t2)
{
t1.BackColor = Color.Red;
t2.BackColor = Color.Red;
}
Thread n1=new Thread(waits)
使用调用
private void waits(TextBox t1 ,TextBox t2)
{
t1.Invoke(new Action(()=>
{
t1.BackColor = Color.Red;
});
t2.Invoke(new Action(()=>
t2.BackColor = Color.Red;
});
}