title: Wait for Form Mouse click
body: <p>i have a while loop and every time each cycle ends, i print a mesagebox to show the result. when the "ok" button is clicked, the loop continues. What i want is to print my result to a textbox in the main form and the loop will continue when a mouse click is captured in the main form. 
  Any idea? </p>
  
  <p>code:</p>
  
  <pre><code>    private void button1_Click(object sender, EventArgs e)
      {
          StreamReader sr = new StreamReader(File.OpenRead(path)); //read file
          string line = string.Empty;
          while ((line = sr.ReadLine()) != null)
          {
              string iw = encode.I_type(line);     //doWork
              textBox1.Text = (iw);
              label6.Text = (iw.Length).ToString();
              string strHex = encode.add_digits(Convert.ToInt32(iw, 2).ToString("X"), 8);
  
              textBox2.Text = strHex;
              MessageBox.Show(line); // when hit ok, goes at the begining of the while loop
  
          }
  </code></pre>