title: How to update progress bar from a series of inner methods in Winform 2019
body: <p>I have a progress bar in the main form and there is a method called <code>MethodA()</code> in it. Inside in this <code>methodA()</code>, it calls another method <code>Class1.MethodB()</code> and inside in this <code>methodB()</code> it calls another method <code>Class2.MethodC()</code>. And this <code>MethodC()</code> calls another method <code>Class3.MethodD()</code>. In all these methods, some long running process are going on:</p>
  
  <pre><code>class MainForm : Form
  {
      void MethodA()
      {
          // ...
  
          instanceOfClass1.MethodB();
  
          // ...
      }
  }
  
  class Class1
  {
      void MethodB()
      {
          // ...
  
          instanceOfClass2.MethodC();
  
          // ...
      }
  }
  
  class Class2
  {
      void MethodC()
      {
          // ...
  
          instanceOfClass3.MethodD();
  
          // ...
      }
  }
  </code></pre>
  
  <p>The method calls are all instance method calls, not static calls.</p>
  
  <p>How i can update progress bar value here ?. When the button clicks, the progress bar should run and ends when the <code>Class3.MethodD()</code> stops execution ?</p>
  
  <p>How can we update the progress bar which is in the main form from other classes ? I cannot create an instance of the main form and pass as an argument to every classes. There are a lot of other controls in the main form.</p>