if (progressBar.Value == 100) { progressBar.Value = 0; lblProgressPercentage.Text = string.Empty; }
if (ofd.ShowDialog() != DialogResult.Cancel) { int singleBlock = 100 / ofd.FileNames.Count(); for (int i = 0; i < ofd.FileNames.Count(); i++) { ---------------------- Statements ---------------------- } progressBar.Value += singleBlock; lblProgressPercentage.Text = progressBar.Value.ToString() + "% Processed"; int percent = (int)(((double)progressBar.Value / (double)progressBar.Maximum) * 100); progressBar.CreateGraphics().DrawString(percent.ToString() + "%", new Font("Arial", (float)8.25, FontStyle.Regular), Brushes.Black, new PointF(progressBar.Width / 2 - 10, progressBar.Height / 2 - 7)); progressBar.Refresh(); System.Threading.Thread.Sleep(2000); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)