Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am facing problems with progress bar, can any one help me, I am downloading files from FTP, And i want to show that progress with progressbar, Can any one help me with this code?

http://www.mediafire.com/view/?345cd9s7j6stcv2[^]
Posted
Comments
Maciej Los 31-Mar-13 17:58pm    
What a problem?
Don't expect from us to download any file and analyze all code.
Please, post only this part which "not working". Use "Improve question" widget.
[no name] 31-Mar-13 20:06pm    
What code? Hardly anyone will download your entire project from an unknown source and debug it for you. Ever hear of malware? You need to post the actual code that you are having trouble with.
Friendsaa 1-Apr-13 2:06am    
My problem is Messagebox is displaying before progress bar finished. see the below code

private void Form1_Load(object sender, EventArgs e)
{
bgw.RunWorkerAsync();


}



private void bgw_DoWork(object sender, DoWorkEventArgs e)
{
for (int i = 0; i <= count; i++)
{
bgw.ReportProgress((i * 100) / count);
}
}

private void bgw_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
progressBar1.Value = e.ProgressPercentage;

}

private void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
Application.DoEvents();

MessageBox.Show("Succcesfully Updated");


}

1 solution

Would it be possible to raise an event for you after transfer complete and show the messagebox in the event handler instead?
 
Share this answer
 
Comments
Friendsaa 1-Apr-13 2:06am    
My problem is Messagebox is displaying before progress bar finished. see the below code

private void Form1_Load(object sender, EventArgs e)
{
bgw.RunWorkerAsync();


}



private void bgw_DoWork(object sender, DoWorkEventArgs e)
{
for (int i = 0; i <= count; i++)
{
bgw.ReportProgress((i * 100) / count);
}
}

private void bgw_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
progressBar1.Value = e.ProgressPercentage;

}

private void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
Application.DoEvents();

MessageBox.Show("Succcesfully Updated");


}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900