private void UpdateProgress(int progVal)
{
if (this.progressBar.InvokeRequired)
{
this.progressBar.BeginInvoke(
new Action(() =>
{
this.progressBar.Value = progVal;
}
));
}
else
{
this.progressBar.Value = progVal;
}
if (this.percentageLabel.InvokeRequired)
{
this.percentageLabel.BeginInvoke(
new Action(() =>
{
this.percentageLabel.Text = progVal.ToString() + "%";
}
));
}
else
{
this.percentageLabel.Text = progVal.ToString() + "%";
}
}