title: How MessageBox.Show make loop wait
body: <p>I'm looking for a way to make my program wait for a page to load completely, before it keeps going and executes more code on the loaded document.</p>
  
  <p>I didn't find any good way to do it, but I remembered that when we use <code>MessageBox.Show("some string");</code> the program stops/waits(?) and then keeps going, even in a loop.</p>
  
  <p>So when we have this loop:</p>
  
  <pre><code>for (int i = 0; i &lt; 10; i++)
  {
      MessageBox.Show("i");
  }
  </code></pre>
  
  <p>the <code>i++</code> will not run until I press the OK button.</p>
  
  <p>How were they able to do that?</p>