- 博客(0)
- 资源 (1)
- 收藏
- 关注
c#多线程进度条参考资料WEb
多线程 进度条解决方案。
文本,非项目
.定义 委托
delegate void myDelegate(int i);
myDelegate mydelegate = null;
2.定义方法,显示消息
public void ShowMessage(int i)
{
this.textBox1.Text = i.ToString();
this.progressBar1.Value = i;
}
3.定义方法,驱动消息
public void MyEvent()
{
for (int i = 0; i < 100; i++)
{
Thread.Sleep(100);
this.BeginInvoke(mydelegate, new object[] {i});
}
}
4: 运行
2008-11-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人