1 private void button1_Click(object sender, EventArgs e) 2 { 3 //...处理事件 4 for (int i = 0; i < 5; i++) 5 { 6 Thread.Sleep(1000); 7 } 8 MessageBox.Show("Hello!"); 9 this.button1.Enabled = false; Application.DoEvents(); 10 this.button1.Enabled = true; 11 }
时间: 2024-11-07 07:37:11