Printer.Orientation Property
Gets or sets a value indicating whether documents are printed in portrait or landscape mode.
Namespace: Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Syntax
public short Orientation { get; set; }
public:
property short Orientation {
short get();
void set(short value);
}
member Orientation : int16 with get, set
Public Property Orientation As Short
Property Value
Type: System.Int16
Returns a Short.
Remarks
If you set this property after you call the Print method, a run-time exception will occur.
The following table lists the PrinterObjectConstants values that are valid for the Orientation property.
Constant |
Value |
Description |
---|---|---|
vbPRORPortrait |
1 |
Documents are printed vertically. The height of the page is greater than its width. |
vbPRORLandscape |
2 |
Documents are printed horizontally. The width of the page is greater than its height. |
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 Orientation property. In this example, the dimensions of the document are used to determine the appropriate orientation.
Dim Printer As New Printer
If Printer.Height > Printer.Width Then
Printer.Orientation = vbPRORPortrait
Else
Printer.Orientation = vbPRORLandscape
End If
Printer.Print("Hello")
Printer.EndDoc()
See Also
Printer Class
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 Namespace
bc1bcb98-e13b-4c68-a514-045c042dbf367f9351ea-cb3e-4615-8f70-5a29c165c1a74e434922-3709-49c6-a69d-38120ed72d7a
Return to top