OK, try this:
private delegate void DisplayTextBoxDelegate(int i)
private void button1_Click(object sender, EventArgs e)
{
txt3.Text = "";
var thdDoTextBoxStuff = new Thread(DoTextBoxStuff);
DoTextBoxStuff.IsBackground = true;
DoTextBoxStuff.Start();
}
private void DoTextBoxStuff()
{
for (int i = 0; i <50; i++)
{
Random random = new Random();
int randomNumber = random.Next(100, 150);
txt3.Invoke(new DisplayTextboxDelegate(UpdateTextBoxValue), randomNumber);
Thread.Sleep(500);
}
}
private void UpdateTextboxValue(int iValue)
{
txt3.Text = iValue.ToString();
}
Again, I've not tried the above - but it should get you moving in the right direction.