Printer.Duplex Property
Gets or sets a value that determines whether a page is printed on both sides (if the printer supports this feature).
Namespace: Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Syntax
public short Duplex { get; set; }
public:
property short Duplex {
short get();
void set(short value);
}
member Duplex : int16 with get, set
Public Property Duplex As Short
Property Value
Type: System.Int16
Returns a Short.
Remarks
When you use horizontal duplex printing, the tops of both sides of the page are on the same end of the sheet. When you use vertical duplex printing, the bottom of one page is at the same end of the sheet as the top of the next page.
If you set this property after you call the Print, Circle, Line, or PSet methods on a new page, a run-time exception occurs.
The following table lists the PrinterObjectConstants values that are valid for the Duplex property.
Constant |
Value |
Description |
---|---|---|
vbPRDPSimplex |
1 |
Single-sided printing with the current orientation setting. |
vbPRDPHorizontal |
2 |
Double-sided printing using a horizontal page turn. |
vbPRDPVertical |
3 |
Double-sided printing using a vertical page turn. |
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 Duplex property.
Dim pr As New Printer
Dim ps As New Printing.PrinterSettings
If ps.CanDuplex = True Then
pr.Duplex = vbPRDPVertical
Else
MsgBox("Duplex printing is not supported.")
End If
See Also
Printer Class
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 Namespace
7f9351ea-cb3e-4615-8f70-5a29c165c1a7bc1bcb98-e13b-4c68-a514-045c042dbf364e434922-3709-49c6-a69d-38120ed72d7a
Return to top