PrintForm.PrinterSettings Property

Gets or sets a PrinterSettings object that you can use to specify various properties of a printer.

Namespace:  Microsoft.VisualBasic.PowerPacks.Printing
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

[BrowsableAttribute(false)]
public PrinterSettings PrinterSettings { get; set; }

Property Value

Type: System.Drawing.Printing.PrinterSettings
Returns a PrinterSettings object.

The settings returned by the PrinterSettings are the same settings that are exposed to a user in the Print dialog box.

You can specify several printer settings by using the PrinterSettings property. For example, use the Copies property to specify the number of copies to print. Use the PrinterName property to specify the printer to use, and use the PrintRange property to specify the range of pages to print.

NoteNote

To enable the user to select the settings, you may want to use a PrintDialog component to display a standard Print dialog box, and then assign the PrinterSettings property value to the PrinterSettings property.

The following code example demonstrates how to use the PrinterSettings property to set the number of copies to print and to check whether the specified printer is valid. This example requires that you have a PrintForm component named PrintForm1 on a form.

PrintForm1.PrinterSettings.Copies = 2
If PrintForm1.PrinterSettings.IsValid Then
    PrintForm1.Print()
End If

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