Application.DoEvents()的最大作用就是時時響應, 可以看做是個線程的一個封裝
private void button1_Click(object sender, EventArgs e) { for (int i = 0; i < 990000; i++) { textBox1.Text = i.ToString(); Application.DoEvents();//時時響應文本框中的值 } }
但是不要濫用DoEvents(); 性能比較低
Application.DoEvents()的最大作用就是時時響應, 可以看做是個線程的一個封裝
private void button1_Click(object sender, EventArgs e) { for (int i = 0; i < 990000; i++) { textBox1.Text = i.ToString(); Application.DoEvents();//時時響應文本框中的值 } }
但是不要濫用DoEvents(); 性能比較低
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。