title: Modal dialog prevents return of focus after printing
body: <p>I have a program which prints a series of pages, stopping after each page to ask the user to verify they want it printed and insert the paper to printed to.  The problem is, in some situations, it goes and prints the item, which pops up a print progress window, and then when that window goes away it tries to return focus to the form.  But by that time, the next modal dialog is being shown, and that prevents the original window from being refocused.</p>
  
  <p>Sometimes it even brings a window from the background to cover my original form.  It works fine if I don't show any dialogs after printing, but that's not really an option.  This only occurs with certain printers.</p>
  
  <p>If anyone else has run into this, how did you fix it?</p>
  
  <p>Sample code:</p>
  
  <pre><code>private void Print(int ItemCount)
  {
      for (int i = 0; i &lt; ItemCount; i++)
      {
          MessageBox.Show("Insert paper to print to.");
          using (PrintDocument PrintDoc = new PrintDocument())
          {
              PrintDoc.PrintPage += new PrintPageEventHandler(PrintDoc_PrintPage);
              PrintDoc.Print();
          }
      }
  }
  
  void PrintDoc_PrintPage(object sender, PrintPageEventArgs e)
  {
      e.Graphics.DrawEllipse(Pens.Black, new Rectangle(10, 10, 100, 100));
      e.HasMorePages = false;
  }
  </code></pre>