PageSetupDialog.PrinterSettings Property

Gets or sets the printer settings that are modified when the user clicks the Printer button in the dialog.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public PrinterSettings PrinterSettings { get; set; }

Property Value

Type: System.Drawing.Printing.PrinterSettings
The PrinterSettings to modify when the user clicks the Printer button. The default is null.

The following code example demonstrates the PageSetupDialog using the PageSettings, PrinterSettings, and ShowNetwork properties. To run this example, place it in a form containing a Button named Button1, a ListBox named ListBox1, and a PageSetupDialog named PageSetupDialog1. Ensure the button's click event is connected to the event-handling method in this example.

	//This method displays a PageSetupDialog object. If the 
	// user clicks OK in the dialog, selected results of 
	// the dialog are displayed in ListBox1. 
    private void Button1_Click(System.Object sender, System.EventArgs e)

        // Initialize the dialog's PrinterSettings property to hold user 
        // defined printer settings.
        PageSetupDialog1.PageSettings =
            new System.Drawing.Printing.PageSettings();

        // Initialize dialog's PrinterSettings property to hold user 
        // set printer settings.
        PageSetupDialog1.PrinterSettings =
            new System.Drawing.Printing.PrinterSettings();

        //Do not show the network in the printer dialog.
        PageSetupDialog1.ShowNetwork = false;

        //Show the dialog storing the result.
        DialogResult result = PageSetupDialog1.ShowDialog();

        // If the result is OK, display selected settings in 
        // ListBox1. These values can be used when printing the 
        // document. 
        if (result == DialogResult.OK)
            object[] results = new object[]{ 


.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft