Using the Printing Controls

You could use the PageSettings and PrinterSettings classes directly to allow the user to set such things as the orientation of the printer or the paper tray to use. But that would require you to develop a user interface for changing such settings. Windows includes a standard Page Setup dialog box, as well as other standard printer-related dialog boxes. Fortunately, these dialog boxes are available directly to Windows forms. In fact, four components can be handy when you're dealing with printing issues:

  • The PageSetupDialog component

  • The PrintDialog component

  • The PrintPreviewDialog component

  • The PrintPreviewControl control

The remainder of this chapter describes how you can use these components to add standard Windows printing ...

Get MCAD/MCSD.NET Training Guide (Exam 70-316): Developing and Implementing Windows®-Based Applications with Microsoft® Visual C#™ .NET and Microsoft® Visual Studio® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.