Export (0) Print
Expand All

Printer.Write Method

Prints text to a page without adding a carriage return.

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

public void Write(
	params Object[] args
)

Parameters

args
Type: System.Object[]
A parameter array containing optional printing parameters.

The Write method resets CurrentX and CurrentY to the end of the current line after executing. To move to the next line after printing (insert a carriage return), call the Print method instead.

Multiple expressions can be separated by either a space or a semicolon.

NoteNote

Because the Print method typically prints with proportionally-spaced characters, there is no correlation between the number of characters printed and the number of fixed-width columns that those characters occupy. For example, a wide letter, such as a "W," occupies more than one fixed-width column, and a narrow letter, such as an "i," occupies less than one column. To allow for cases in which wider than average characters are used, your tabular columns must be positioned far enough apart. Alternatively, you can print in a fixed-pitch font (such as Courier) to make sure that each character occupies only one column.

The args() parameter array has the following syntax and parts:

{Spc(n) | Tab(n)} expression charPos

Parameter

Description

Spc(n)

Optional. Used to insert space characters in the output, where n is the number of space characters to insert.

Tab(n)

Optional. Used to position the insertion point at an absolute column number, where n is the column number. Use Tab without an argument to position the insertion point at the start of the next print zone.

expression

Optional. Numeric expression or string expression to print.

charPos

Optional. Specifies the insertion point for the next character. Use a semicolon (;) to position the insertion point immediately after the last character displayed. Use Tab(n) to position the insertion point at an absolute column number, where n is the column number. Use Tab without an argument to position the insertion point at the start of the next print zone. If charPos is omitted, the next character is printed on the next line.

NoteNote

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 2010. 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.

The following example demonstrates the Print method.

Dim Printer As New Printer

Community Additions

ADD
Show:
© 2014 Microsoft