我使用這個改變在其他線程的東西:MethodInvoker +拉姆達+論據+ CrossThread操作
MethodInvoker m =() => { login_submit.Text = "Login"; };
if (InvokeRequired)
{
BeginInvoke(m);
}
else
{
Invoke(m);
}
這是工作的罰款。
我該如何通過argumets到那個lamba表達式?
我想做某事這樣的:
MethodInvoker m = (string txt) => { login_submit.Text = txt; };
if (InvokeRequired)
{
BeginInvoke(m); // I need to pass txt string in some way here.
}
else
{
Invoke(m); // I need to pass txt string in some way here.
}
什麼是「某事」? – 2011-04-24 13:14:09
@Cody,我認爲這是「東西」的簡稱。 – svick 2011-04-24 13:16:08