The PrintDialog Control
Any application worth its salt will incorporate some kind of printing capabilities, whether it is basic printing or more sophisticated printing, such as allowing a user to print only selected text or a range of pages. In this next section of the chapter you explore basic printing. You take a look at several classes that help you to print text from a file.
Visual Basic .NET provides the PrintDialog control. It does not actually do any printing but enables you to select the printer that you want to use and set the printer properties such as page orientation and print quality. It also enables you to specify the print range. You will not be using these features in this next example, but it is worth noting that this functionality is available in the PrintDialog control as shown:
Like the previous dialog boxes that you have examined, the Print dialog box provides OK and Cancel buttons; thus, its ShowDialog method returns a DialogResult of OK or Cancel. You can then use this result in an If . . . End If statement and test for the DialogResult.
Chapter 7.6.1: The Properties of PrintDialog
Chapter 7.6.2: Using the PrintDialog Control
Chapter 7.6.3: The PrintDocument Class
Chapter 7.6.4: Printing a Document
|