B
Billy Bob
Hello
I'm wanting to run through a for loop, and update a text box control to the
value as I loop through, but the only value thats's ever displayed in the
text box is that last value of the counter. Am I missing something???
As I step into the code, I can see the textbox1 test gets update, but I
never see it in the actual text box
private void button1_Click(object sender, EventArgs e)
{
for (int y = 1; y <= 5000; y++)
{
int x = Thread.CurrentThread.GetHashCode();
textBox1.Text = "The number is" + y.ToString();
Thread.Sleep(2000);
}
}
I'm wanting to run through a for loop, and update a text box control to the
value as I loop through, but the only value thats's ever displayed in the
text box is that last value of the counter. Am I missing something???
As I step into the code, I can see the textbox1 test gets update, but I
never see it in the actual text box
private void button1_Click(object sender, EventArgs e)
{
for (int y = 1; y <= 5000; y++)
{
int x = Thread.CurrentThread.GetHashCode();
textBox1.Text = "The number is" + y.ToString();
Thread.Sleep(2000);
}
}