winform 如何显示方法的处理进度

accpchenjun 2010-11-10 11:36:02
如何用 progressBar 显示方法的处理进度
...全文
163 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
accpchenjun 2010-11-10
  • 打赏
  • 举报
回复
你们说的这些都在循环内的进度 循环外的进度也要算到进度中来 如何做
xiaowei5780651 2010-11-10
  • 打赏
  • 举报
回复
你也还需要有显示进度的数值吗?
xiaowei5780651 2010-11-10
  • 打赏
  • 举报
回复
this.progressBar1.Minimum = 0;
this.progressBar1.Maximum = datatable.count; //随便给个值
this.progressBar1.step=1;
this.progressBar1.values=0;
for(int i=0;i<datatable.count;i++)
{
this.progressBar1.perStep(); /////这个方法没记住,不好意思,意思差不多啦,呵呵
}
gp549483387 2010-11-10
  • 打赏
  • 举报
回复
private void btn_Begin_Click(object sender, EventArgs e)
{
this.progressBar1.Minimum = 0;
this.progressBar1.Maximum = 20;
for (int i = 0; i < 20; i++)
{
this.progressBar1.Value = i + 1;
//this.label1.Text = i + 1 + "%";
//System.Threading.Thread.Sleep(1000);

}
this.label1.Text = "操作已完成!";
}
accpchenjun 2010-11-10
  • 打赏
  • 举报
回复
不要说理论 贴代码
guoyanhong1111 2010-11-10
  • 打赏
  • 举报
回复
懂得线程就很好处理啊!
lid123456 2010-11-10
  • 打赏
  • 举报
回复
加一个线程

110,537

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧