1. printdocument
The document object that contains the printed content page. This object is used for previewing and printing. Therefore, this object is the most important in the print function.
1> printpreviewdialog. Document = printdocument;
Printpreviewdialog. showdialog (); --- the preview window is displayed.
2> printdocument. Print () --- print directly
3> During previewing and printing, the printpage event of this object needs to be triggered (during multi-Page Preview and printing, check whether the event is complete at the end of the event; otherwise, print E. hasmorepages = true;). The event parameter printpageeventargs contains the required information for previewing and printing.
2. printpreviewdialog
Print preview window components
1> after the preview window is opened, it is a small window by default. The visual effect is not very good. To set the preview window size, you need to set the width and height attributes of this object;
2> you can set the attributes of the printpreviewcontrol object on the preview page;
3. printpreviewcontrol
Print the containers that contain pages in the preview window
1> if multiple pages are printed, You need to drag the scroll bar to preview each page separately. You need to set the rows attribute of this object. The preview page contains multiple pages based on the rows value;
2> after the preview window is opened, the default zoom ratio of the page to be previewed is 0.3, which is not visually good. You can set the zoom attribute of this object to 1, and the page can be enlarged according to the zoom ratio of 100%;
4. pagesetupdialog
Page settings for previewing and printing. Common settings include page margin settings, horizontal and vertical settings.
5. printdialog
Set the printer, including the hardware device that selects the output content and the number of copies.