WPF not updating textbox while in progress
问题 I have this code: void wait(int ms) { System.Threading.Thread.Sleep(ms); } private void button1_Click(object sender, RoutedEventArgs e) { info.Text = "step 1"; wait(1000); info.Text = "step 2"; wait(1000); info.Text = "step 3"; wait(1000); info.Text = "step 4"; wait(1000); } And problem is that textbox.text is updated after whole void button1_Click finished. It is not updated ON AIR :( Please, How to do that? 回答1: Just do this. private void button1_Click(object sender, RoutedEventArgs e) {