title: How to display a message while program is running?
body: <p>I am working on a user interface in C#.</p>
  
  <p>When the program is running (this process takes several minutes...), before run, I want a message is displayed and after run, the message will disappear automatically. </p>
  
  <p>My aim is to give an information message like 'Running, please wait' to the user.</p>
  
  <p>I tried the code shown below:
  (formMsgWait has only a label 'Running, please wait')</p>
  
  <pre><code>private void btnExit_Click(object sender, EventArgs e)
  {
      using (formMsgWait fMsgWait = new formMsgExit())
      {
          fMsgWait.Show();
          System.Windows.Forms.Application.DoEvents();
  
          ...statement 1
          ...statement 2
          ...
      }
  }
  </code></pre>
  
  <p>When run to <code>System.Windows.Forms.Application.DoEvents();</code> the program doesn't run continue, so all of the statements below doesn't do (...statement 1, ...statement 2, ...), formMsgWait doesn't close.</p>
  
  <p>Is there anyway to do that?</p>
  
  <p>Any tips on these will be great help.</p>