private delegate string myDelegate1(string str1,string str2);
private string updateText(string str1, string str2)
{
this.textBox1.Text = str1;
return str1;
}
private void doMethod()
{
for (int i = 0; i < 100000; i++)
{
myDelegate1 md1 = new myDelegate1(updateText);
this.textBox1.Invoke(md1, i.ToString(),"");
MessageBox.Show(Invoke(md1, i.ToString(), "").ToString());
}
}
Thread myThread = new Thread(doMethod);
myThread.Start();