title: Form freezes during for loop
body: <p>I ping 50 IP addresses but the program freezes when I click start.</p>
  
  <p>How can i do it without freezing.</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      string IP = textBox1.Text;
      string[] IPBlocks = IP.Split('.');
      for (int x = 0; x &lt; 50; x++)
      {
          System.Threading.Thread.Sleep(50);
          int IPLastBlock = Int32.Parse(IPBlocks[3]) + (x+1);
          IP = IPBlocks[0]+"."+ IPBlocks[1]+"."+ IPBlocks[2]+"."+ IPLastBlock;
          bool pingStatus = PingHost(IP);
          textBox2.Text += String.Format("{0} =&gt; {1} \r\n", IP, pingStatus);
      }
  }
  </code></pre>