title: cannot update status bar text in windows form
body: <p>In my windows forms application I am trying to update the text on my status bar but unable to do so .
  here is my code :</p>
  
  <pre><code>public void CreateMyStatusBar(string msg = "Ready")
   {
              StatusBar statusBar1 = new StatusBar();
  
              this.Invoke(new Action(() =&gt;
              {
                  statusBar1.Text = msg;
                  statusBar1.Update();
              }));
  
  
              statusBar1.Invalidate();
  
              statusBar1.Refresh();
  
              statusBar1.Update();
  
              Form1.gui.Controls.Add(statusBar1);
  
  }
  </code></pre>
  
  <p>Form1 is my main form and gui is defined as <code>public static Form1 gui;</code> in Form1.cs.</p>
  
  <p>Whenever I call </p>
  
  <blockquote>
    <p>CreateMyStatusBar("ABC")</p>
  </blockquote>
  
  <p>function it shows the text sent to it on the first call. but when this function is called again the text doesn't get updated.</p>
  
  <p>I went through various posts like <a href="https://social.msdn.microsoft.com/Forums/windows/en-US/fea2c99a-9cf0-4226-8756-2d1ef5934bcc/c-statuslabel-text-wont-update?forum=winforms" rel="nofollow noreferrer">this</a> and <a href="https://stackoverflow.com/questions/18469495/update-status-bar-text">this</a> and came to write the above code but it doesn't seem to work. Can anyone tell me where I am going wrong or what i must do to resolve this?</p>