G
Guest
Hi,
I have a c# program that needs to show the progressbar which is circular
processbar,just like the one when windows xp loading. I tried below:
private void TimeConsumingOperation(BackgroundWorker bw)
{
int percentComplete...; //???is it right
/*Do something--time consuming work*/
bw.ReportProgress(percentComplete++)//???is it right
}
private void button1_Click(object sender, EventArgs e)
{
this.progressBar1.Style = ProgressBarStyle.Marquee;
this.backgroundWorker1.RunWorkerAsync();
}
private void button2_Click(object sender, EventArgs e)
{
this.backgroundWorker1.CancelAsync();
}
private void backgroundWorker1_ProgressChanged(object sender,
ProgressChangedEventArgs e)
{
this.progressBar1.Value = e.ProgressPercentage;
}
but it does not work, how to solve it?
thanks.
I have a c# program that needs to show the progressbar which is circular
processbar,just like the one when windows xp loading. I tried below:
private void TimeConsumingOperation(BackgroundWorker bw)
{
int percentComplete...; //???is it right
/*Do something--time consuming work*/
bw.ReportProgress(percentComplete++)//???is it right
}
private void button1_Click(object sender, EventArgs e)
{
this.progressBar1.Style = ProgressBarStyle.Marquee;
this.backgroundWorker1.RunWorkerAsync();
}
private void button2_Click(object sender, EventArgs e)
{
this.backgroundWorker1.CancelAsync();
}
private void backgroundWorker1_ProgressChanged(object sender,
ProgressChangedEventArgs e)
{
this.progressBar1.Value = e.ProgressPercentage;
}
but it does not work, how to solve it?
thanks.