private void SetAppStatusBar(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 (this.appProgressBar.InvokeRequired) { SetAppStatusBarCallback d = new SetAppStatusBarCallback(SetAppStatusBar); this.Invoke(d, new object[] { value }); } else { this.appProgressBar.Value = value; Console.WriteLine("progress bar value " + value); } }