this.progressBar.Properties.Maximum = 100;
this.progressBar.Properties.Step = 1;
this.progressBar.EditValue = 0;
for (int i = 0; i < 100; i++)
{
await Task.Run(() =>
{
// 模拟耗时操作
System.Threading.Thread.Sleep(100);
});
if (this.progressBar.InvokeRequired)
{
var meth = new MethodInvoker(() =>
{
this.progressBar.PerformStep();
this.progressBar.Refresh();
});
this.progressBar.Invoke(meth);
}
else
{
this.progressBar.PerformStep();
this.progressBar.Refresh();
}
}
dev进度条 progressBar
最新推荐文章于 2022-04-28 11:54:24 发布
4215

被折叠的 条评论
为什么被折叠?



