Game Development Reference
In-Depth Information
SimplePrintDocument printDocument = new SimplePrintDocument(inputText,
printFont);
if (cachedSettings != null)
printDocument.DefaultPageSettings = cachedSettings;
PrintDialog printDialog = new PrintDialog();
printDialog.Document = printDocument;
if (printDialog.ShowDialog() == DialogResult.OK)
printDocument.Print();
}
}
Figure 21.2 shows the Page Setup dialog in action.
Figure 21.2 Page Setup dialog in action.
Supporting Print Preview
The last common print feature is the ability to preview a document before actually
printing it. This is done with the PrintPreviewDialog class. Simply attach your print
document to the Document property of the dialog and show the dialog as usual. The
following code shows how to do this.
Search Nedrilad ::




Custom Search