Visual C#

The Page Setup Dialog Box

As opposed to directly printing a file, a user may want to perform some preliminary preparation on the document or the printer. Microsoft Windows provides…

1 min read247 words

Introduction#

Instead of sending a file straight to the printer, users often need to adjust document or printer settings beforehand. For these tasks, Microsoft Windows includes a specific Page Setup dialog box:

To provide a Page Setup to your application, you can use the PageSetupDialog button from the Toolbox. The PageSetupDialog control is based on the PageSetupDialog class which derives from the CommonDialog class.

Characteristics of the Page Setup Dialog Box#

Interacting with the Page Setup dialog requires the selection of a printer. Generally, the operating system pre-selects the computer's default printer for this purpose. If a different printer is needed, the user can use the Printer button to choose another device from the Name dropdown menu:

The Page Setup Printer dialog provides tools for both developers and users to fine-tune the printing operation. This can be managed programmatically via the PageSetupDialog.PrinterSettings property, which utilizes the PrinterSettings class. The specific features available in the Page Setup dialog are determined by the driver of the printer chosen in the Name box. Users can modify paper characteristics, such as selecting a paper size from the Size combo box, which is governed by the PageSettings class. If a printer supports multiple trays, the user can choose which one to use. For network printers, a Network button can be made available; its visibility is toggled using the PageSetupDialog.ShowNetwork property. Additionally, the AllowOrientation property determines whether the user can toggle between Landscape and Portrait modes. Main Page Copyright © 2008 C# Key