//声明一个委托
        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 { }
                }
                else { this.progressBar1.Value++; }
            }
        }

相关文章:

  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-14
  • 2022-02-16
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
  • 2021-10-13
  • 2021-10-28
  • 2022-01-02
相关资源
相似解决方案