JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Print Preview Dialogs

You use Print Preview dialogs to let the user see what a document will look like when it's printed. This dialog is supported with the PrintPreviewDialog class. This dialog contains buttons for printing, zooming in, displaying one or multiple pages, and closing the dialog box. You can see it at work in Figure 9.8 from the Printing example on the CD-ROM.

Click To expand
Figure 9.8: The Print Preview dialog.

The dialog's major property is Document, which sets the document to be previewed, and the document must be a PrintDocument object. There's not much else to do here—this dialog simply displays the document as it will be printed. Print Preview dialogs are based on the PrintPreviewControl object (see the next topic), and you can set some of the properties of that control directly, such as the Columns and Rows properties (which set the number of pages displayed horizontally and vertically) with properties like PrintPreviewDialog1.PrintPreview Control.Columns or PrintPreviewDialog1.PrintPreview Control.Rows. You also can use PrintPreviewControl objects directly to create your own custom print preview dialog boxes—see the next topic for the details.

Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor