private void ProgressBarStatusChanged(object sender, SocStatusEventArgs e) { if (this.ProgressBarFileReceiving.InvokeRequired) { CallbackProgressBarFileStream d = new CallbackProgressBarFileStream(ProgressBarStatusChanged); this.Invoke(d, new object[] { sender, e }); } else { this.ProgressBarFileReceiving.Value = (int)(100 * e.Status.fileSizeDone / e.Status.FileSize); Logger.info("ProgressBarFileReceiving.Value=" + ProgressBarFileReceiving.Value); } }