progressBar如何不阻塞ui线程

                       MethodInvoker mi = new MethodInvoker(() =>
                        {
                            progressBar1.Value += progressBar1.Step;
                            this.lblprass.Text = this.progressBar1.Value.ToString() + "/" + this.progressBar1.Maximum.ToString();
                        });
                        this.BeginInvoke(mi);
                        System.Threading.Thread.Sleep(1000);//暂停1秒

 

posted @ 2020-05-27 13:20  萌橙  阅读(334)  评论(0编辑  收藏  举报