当前位置: 编程技术>.net/c#/asp.net
C# 多线程更新进度条progressBar控件的代码一例
来源: 互联网 发布时间:2014-08-30
本文导语: C#进度条的示例代码。 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Threading; namespace temp { delegate void SetValueCallback(int value); ...
C#进度条的示例代码。
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Threading; namespace temp { delegate void SetValueCallback(int value); public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Thread t = new Thread(new ThreadStart(Foo)); t.Start(); } private void Foo() { for (int i = 1; i