zakary - My txt file is 327kb.
But after bumping my head a few times I think I found the error:
The error was actually in the method UpdateProgress().
In my original post,
Line 44:
CODE
label1.Text = Convert.ToString(Convert.ToInt64(label1.Text) + 1);
Should read:
CODE
label1.Text = Convert.ToString(Convert.ToInt64(progressBar.Value) + 1);
The original code was trying to update the label.Text value using the label.Text value and causing a circle and therefore the error.
The progress bar now runs right through and the label counts up but goes to 101. It should stop at 100. This is how I'm displaying only to 100.
csharp
// This will run in the main thread so it can update the controls for us.
private void UpdateProgress()
{
progressBar1.Value += 1;
// Here we are just updating a label to show the progressbar value
if (progressBar1.Value < 100)
{
label1.Text = Convert.ToString(Convert.ToInt64(progressBar1.Value) + 1);
}
}
Is there a better way?