Partager via


Printer.Line Method (Single, Single)

Prints lines on a page.

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

Syntax

'Déclaration
Public Sub Line ( _
    x2 As Single, _
    y2 As Single _
)
public void Line(
    float x2,
    float y2
)
public:
void Line(
    float x2, 
    float y2
)
member Line : 
        x2:float32 * 
        y2:float32 -> unit 
public function Line(
    x2 : float, 
    y2 : float
)

Parameters

  • x2
    Type: System.Single
    Single value indicating the horizontal coordinate of the endpoint for the line being printed. The starting point for the line is determined by the CurrentX and CurrentY property values.
  • y2
    Type: System.Single
    Single value indicating the vertical coordinate of the endpoint for the line being printed. The starting point for the line is determined by the CurrentX and CurrentY property values.

Remarks

To print connected lines, begin a subsequent line at the endpoint of the previous line.

The width of the line printed depends on the setting of the DrawWidth property. The manner in which a line is printed depends on the setting of the DrawStyle property.

When Line runs, the CurrentX and CurrentY properties are set to the endpoint specified by the parameters.

To draw a rectangle or filled rectangle, use one of the overloaded Line methods.

Notes

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.

Examples

The following example demonstrates how to print a line.

Dim pr As New Printer
pr.CurrentY = 500
pr.Line(pr.Width, 500)
pr.EndDoc()

.NET Framework Security

See Also

Reference

Printer Class

Line Overload

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