title: How to display please wait image while response is being returned from server
body: <p>I am using an Windows based application where I get a response from another server. </p>
  
  <p>It's taking too much time so I want to display image of please wait to the user until it's done. </p>
  
  <p>How can I do this?</p>
  
  <pre><code>private void btnSubmit_Click(object sender, EventArgs e)
  {  
      WebRequest request = null;
      HttpWebResponse response = null;
      Stream stream = null;
      StreamReader reader = null;
      string url = txtURL.Text.ToString();
  
      if (url != "")
      {
          try
          {
              // Display Please Wait Image
              Application.Run(new Form1());
  
              string NavigateURL = "http://" + url + Properties.Settings.Default.portAppName;
              request = HttpWebRequest.Create(NavigateURL + "connectionParam/PostCon");
              request.Method = "POST";
              request.ContentType = "text/xml";
              response = (HttpWebResponse)request.GetResponse();
              if (response.StatusCode == HttpStatusCode.OK)
              {
                  // My stuff
              }
          }
          catch(Exception ex)
          { }
      }
  }
  </code></pre>