private SetProgressBarValue ( System.Windows.Forms.ToolStripProgressBar pb, int value ) : void | ||
pb | System.Windows.Forms.ToolStripProgressBar | |
value | int | |
return | void |
private void SetProgressBarValue(ToolStripProgressBar pb, int value)
{
// InvokeRequired required compares the thread ID of the
// calling thread to the thread ID of the creating thread.
// If these threads are different, it returns true.
if (statusStrip1.InvokeRequired)
{
SetProgressBarValueCallback d = new SetProgressBarValueCallback(SetProgressBarValue);
statusStrip1.BeginInvoke(d, new object[] { pb, value });
}
else
{
pb.Value = value;
}
}