ComponentOne VSView 8.0
Orientation Property

Returns or sets the paper orientation.

Syntax

[form!]VSPrinter.Orientation[ = OrientationSettings ]

Remarks

The settings for the Orientation property are described below:

 

Constant

Value

Description

orPortrait

0

The page is rendered in Portrait mode (tall).

orLandscape

1

The page is rendered in Landscape mode (wide).

 

The default value for this property depends on the printer driver and the current printer settings.

This property relies on the printer driver, and may or may not be available on a particular printer. After setting this property, read it back to make sure the driver made the change, or check the Error property. If it is set to vperDeviceIncapable (7), then the printer does not support the selected setting and you should take appropriate action.

You can change the Orientation property while creating a document, so that some pages are rendered in landscape mode and others in portrait. To do this, you must switch the orientation before the page starts. For example, the following code creates a document with some text in portrait mode, then a chart in landscape mode, followed by more text in portrait mode:

Private Sub Command1_Click()

    Dim i%

    With vp

   

    ' start in portrait mode

    .Orientation = orPortrait

   

    .StartDoc

   

    ' print some text in portrait mode

    For i = 1 To 10

        .Paragraph = i & ": This is portrait mode."

    Next

   

    ' print graphics in landscape mode

    .Orientation = orLandscape

    .NewPage

    .Paragraph = "This is landscape mode."

    .BrushStyle = bsTransparent

    .DrawCircle .PageWidth / 2, .PageHeight / 2, .PageHeight / 4

   

    ' print more text in portrait mode

    .Orientation = orPortrait

    .NewPage

    For i = 1 To 10

        .Paragraph = i & ": This is portrait mode."

    Next

   

    .EndDoc

    End With

End Sub

The code above produces the following result:

 

 

Data Type

OrientationSettings (Enumeration)

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback