Printer.Width Property

 

Gets or sets the width of a page.

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

Syntax

public int Width { get; set; }
public:
property int Width {
    int get();
    void set(int value);
}
member Width : int with get, set
Public Property Width As Integer

Property Value

Type: System.Int32

Returns an Integer.

Remarks

For the Printer object, the Height and Width properties are always measured in twips; they return the physical dimensions of the paper that the printing device is currently set to use. If set at run time, values in these properties are used instead of the setting of the PaperSize property.

If you set the Height and Width properties for a printer driver that does not allow these properties to be set, no error occurs. The size of the paper remains unchanged.

If you set a Height or Width value for a printer driver that does not allow that value, no error occurs. The property is set to a value that the driver allows. For example, you could set Height to 150 and the driver would set it to 144.

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 retrieve the Height and Width property values.

Dim Printer As New Printer
Dim nHeight As Integer = Printer.Height
Dim nWidth As Integer = Printer.Width
Printer.Print("Paper size is " & CStr(nHeight) & " by " _
    & CStr(nWidth) & " twips")
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