我一直在尋找約3小時,無法得到這個調用工作。我需要調用,因爲它叫做不同的線程,並說它不穩定。調用自我繞過不同的線程? C#
這裏是我打電話是什麼(我這樣稱呼它textBox1_TextChanged(null, null);
):
private void textBox1_TextChanged(object sender, EventArgs e)
{
if(this.InvokeRequired)
{
this.Invoke(this?WHAT GOES HERE, null); // I know it should be a delegate or something but I can't change this to that
}
else
{
string temp = "";
temp += TextToAdd;
textBox1.Text = "s";
}
}
提示:通常你想避免使用'Invoke',因爲1)它會阻塞工作線程2)會導致線程死鎖。考慮使用'BeginInvoke'來代替Jonas在 – MickyD