public static void UpdateProgress(ProgressBarX progress, int val, int max) { IAsyncResult res; res = progress.BeginInvoke(new InvokeProgress(UpdateProgressX), new object[] { progress, val, max }); progress.EndInvoke(res); }
public void UpdateProgressBar(ProgressBarX progressBarX, int healtPercentage) { if (progressBarX.InvokeRequired) { progressBarX.BeginInvoke( new MethodInvoker( delegate { UpdateProgressBar(progressBarX, healtPercentage); })); } else { progressBarX.Value = healtPercentage; } }