Share via


Printer.Copies Property

 

Gets or sets a value that determines the number of copies to be printed.

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

Syntax

public short Copies { get; set; }
public:
property short Copies {
    short get();
    void set(short value);
}
member Copies : int16 with get, set
Public Property Copies As Short

Property Value

Type: System.Int16

A Short representing the number of copies to be printed.

Remarks

If the PrintAction property is set to a value other than PrintToPrinter, this property is ignored.

If the Copies property is set to a value that is less than 1, a run-time exception occurs.

If you set this property after you call the Print, Circle, Line, or PSet methods on a new page, a run-time exception occurs.

Note

Functions and objects in the Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic. In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework. They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.

Examples

The following example demonstrates how to set the Copies property. It assumes that you have a TextBox named txtCopies that is used at run time to determine the number of copies to print.

Dim pr As New Printer
Dim numCopies As Short
numCopies = CShort(txtCopies.Text)
pr.Copies = numCopies
pr.Print("Hello")
pr.EndDoc()

See Also

Printer Class
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 Namespace

7f9351ea-cb3e-4615-8f70-5a29c165c1a74e434922-3709-49c6-a69d-38120ed72d7abc1bcb98-e13b-4c68-a514-045c042dbf36

Return to top