次の方法で共有


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)

Syntax

'Declaration
Public Sub Write ( _
    ParamArray args As Object() _
)
public void Write(
    params Object[] args
)
public:
void Write(
    ... array<Object^>^ args
)
member Write : 
        args:Object[] -> unit
public function Write(
    ... args : Object[]
)

Parameters

  • args
    Type: array<System.Object[]

    A parameter array containing optional printing parameters.

Remarks

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.

Note

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)} expressioncharPos

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.

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 the Print method.

Dim Printer As New Printer

.NET Framework Security

See Also

Reference

Printer Class

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

Other Resources

Printer Compatibility Library

How to: Fix Upgrade Errors by Using the Printer Compatibility Library (Visual Basic)

Deploying Applications That Reference the Printer Compatibility Library