В моето C# приложение се опитвам да генерирам визуализация за печат, без диалоговият прозорец за напредъка да се показва на екрана.
Вярвам, че можете да използвате PrintDocument.PrintController за да предотвратите това, когато печатате реално (т.е. не визуализация на печат), но изглежда не работи, когато извършвате визуализация на печат.
Моят код е както следва:
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;
}
Визуализацията на печат работи точно както искам, с изключение на факта, че се показва диалоговият прозорец за напредъка на визуализацията на печат.
Моля за предложения?