public partial class Form1 : Form { Action SetTextValue; public Form1() { InitializeComponent(); CheckForIllegalCrossThreadCalls = false; SetTextValue = Text_Update; }
private void button1_Click(object sender, EventArgs e) { Thread th = new Thread(new ThreadStart(Text_Update)); th.Start(); } public void Text_Update() { for(int i = 0; i < 100; i++) { textBox1.Text = i.ToString(); Thread.Sleep(200); }