谁能实现这个进度条
void ChangeTxt()
{
for (int i = 0; i < 1000; i++)
{
int a = int.Parse(txtNum.Text);
a++;
txtNum.Text = a.ToString();
Console.WriteLine(Thread.CurrentThread.Name + ",a=" + a + ",i=" + i.ToString());
}
}
private void txtNum_TextChanged(object sender, EventArgs e)
{
}
private void btnProblem_Click(object sender, EventArgs e)
{
//ChangeTxt();UI线程自己访问可以通过。
Thread thread = new Thread(ChangeTxt);
thread.Name = "t1";
thread.IsBackground = true;
thread.Start();
Thread thread2 = new Thread(ChangeTxt);
thread2.Name = "t2";
thread2.IsBackground = true;
thread2.Start();
MyThread Myt = new MyThread(ChangeTxt);
}
Lz自己研究了多线程,但进度条写了几次了还不行,谁能帮我把这个进度条弄出来,最好有代码,我还要写更大的测试函数,这样可以帮助我更好的理解。