title: How can I prevent the Print Progress dialog appearing when performing a print preview
body: <p>In my C# application, I'm attempting to generate a print preview without the progress dialog appearing on screen.</p>
  
  <p>I believe you can use <a href="http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.printcontroller.aspx" rel="noreferrer">PrintDocument.PrintController</a> to prevent this when printing for real (i.e. not a print preview), however it doesn't seem to work when performing a print preview.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>public FrmDeliveryNotePrintPreview(DeliveryNote deliveryNote)
  {
      InitializeComponent();
  
      this.Text = "Delivery Note #" + deliveryNote.Id.ToString();
  
  
      // The print preview window should occupy about 90% of the
      // total screen height
  
      int height = (int) (Screen.PrimaryScreen.Bounds.Height * 0.9);
  
  
      // Making an assumption that we are printing to A4 landscape,
      // then adjust the width to give the correct height:width ratio
      // for A4 landscape.
  
      int width = (int) (height / 1.415);
  
  
      // Set the bounds of this form. The PrintPreviewControl is
      // docked, so it should just do the right thing
  
      this.SetBounds(0, 0, width, height);
  
      PrinterSettings printerSettings = new PrinterSettings();
      PrintDeliveryNotes pdn = new PrintDeliveryNotes(
          new DeliveryNote[] { deliveryNote },
          printerSettings);
      PrintDocument printDocument = pdn.PrintDocument;
      printDocument.PrintController = new PreviewPrintController();
      ppcDeliveryNote.Document = printDocument;
  }
  </code></pre>
  
  <p>The print preview works exactly as I want, apart from the fact that the print preview progress dialog is displayed.</p>
  
  <p>Suggestions please?</p>