Private void button1_Click(object sender, System.EventArgs e) PrintPreviewDialog1.Document = myDocument ' You will have to specify your own print document. ' The print document 'myDocument' used below Private Sub Button1_Click(ByVal sender As System.Object, _īyVal e As System.EventArgs) Handles Button1.Click The example requires that your form has a Button control, a PrintDocument component named myDocument, and a PrintPreviewDialog control. In the example below, no print document is specified. The print document is specified in the Document property. In the following code example, the Button control's Click event handler opens an instance of the PrintPreviewDialog control. Use the ShowDialog method to display the dialog box, specifying the PrintDocument to use. To view pages using the PrintPreviewDialog control The print document specified in the PrintPreviewDialog control's Document property refers to instances of both the PrinterSettings and PageSettings classes, and these are used to render the document in the preview window. Additionally, the PrintPreviewDialog control uses the PageSettings class, just as the PrintPreviewDialog component does. The PrintPreviewDialog control uses the PrinterSettings class. To use the PrintPreviewDialog control at run time, users must have a printer installed on their computer, either locally or through a network, as this is partly how the PrintPreviewDialog component determines how a document will look when printed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |