C#進度條使用之多線程應用淺析
作者:mossan
C#進度條使用之多線程應用是什么情況呢?C#進度條使用之多線程應用是如何實現的呢?那么本文就向你介紹這方面的內容。
C#進度條使用之多線程應用情況是如何實現的呢?讓我們來看看具體的實現:
- //聲明一個委托 ,C#進度條使用之多線程應用
- public delegate void UpdateBar(int iBar);
- //委托使用進度條
- void UpdateMyBar(int iMyBar)
- {
- if (this.progressBar1.Value !=
- this.progressBar1.Maximum)
- {
- if (this.progressBar1.InvokeRequired)
- {
- UpdateBar pb = new UpdateBar(UpdateMyBar);
- IAsyncResult pbaResult =
- this.progressBar1.BeginInvoke(
- pb, new object[] { iMyBar});
- try { pb.EndInvoke(pbaResult); }
- catch { }
- } //C#進度條使用之多線程應用
- else { this.progressBar1.Value++; }
- }
- }
C#進度條使用之多線程應用的相關內容就向你介紹到這里,希望對你了解和學習C#進度條使用之多線程應用有所幫助。
【編輯推薦】
責任編輯:仲衡
來源:
博客園


















