Basically, I would like to update the ProgressBar interface object to FormMain (WindowsForm). I am using .NET 4.0
Here is the code in Form1.Designer.cs
namespace ProgressBarApp { public partial class Form1 : Form { private System.Windows.Forms.ProgressBar curProgressBar; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { CustomProcess theProcess = new CustomProcess(); theProcess.Process(); } } }
Here is the definition of CustomProcess.cs
namespace ProgressBarApp { class CustomProcess { public void Process() { for (int i = 0; i < 10; i++) { Task ProcessATask = Task.Factory.StartNew(() => { Thread.Sleep(1000);
source share