HELP: How can I print in Lanscape

HELP: How can I print in Lanscape

Post by Nigel Findlate » Tue, 20 May 2003 15:41:07



Hallo,

I am having problems in printing in Lanscape. At the
moment all I am trying to do is
draw a rectangle arround the printable area on the
printer. Unfortunately the result is
only part of the rectangle is printed in the upper left
corner of the page and the rest is cut.

Here is a copy of the code that does this. Can anyone see
what is wrong?

Thanks in advance...

Nigel...

8<---

Imports System.Drawing.Printing
Public Class Form1
    Inherits System.Windows.Forms.Form
    Private WithEvents prdoc As New PrintDocument()

    Private Sub prdoc_PrintPage(ByVal sender As Object,
ByVal e As System.Drawing.Printing.PrintPageEventArgs)
Handles prdoc.PrintPage
        Dim pn As Pen = New Pen(Color.Blue, 100)
        e.Graphics.DrawRectangle(pn, e.MarginBounds.Top,
e.MarginBounds.Left, e.MarginBounds.Bottom,
e.MarginBounds.Right)
    End Sub

    Public Sub button1_Click(ByVal eventSender As
System.Object, ByVal eventArgs As System.EventArgs)
Handles Button1.Click

        Dim prset As New PrinterSettings()
        Dim prdialog As New PrintDialog()
        Dim prPageSetupDialog As New PageSetupDialog()

        With prdoc
            .DefaultPageSettings.Landscape = True
        End With

        With prdialog
            .PrinterSettings = prset
            .PrinterSettings =
prPageSetupDialog.PrinterSettings
            .Document = prdoc
            If .ShowDialog <> DialogResult.OK Then Exit Sub
        End With

        With prPageSetupDialog ' Wraps the Win32
PageSetupDlg API.
            .PrinterSettings = prset
            .Document = prdoc
            .AllowPaper = True
            If .ShowDialog <> DialogResult.OK Then Exit Sub
        End With

        prdoc.Print()
    End Sub
End Class

 
 
 

HELP: How can I print in Lanscape

Post by Mike D Sutto » Wed, 21 May 2003 00:09:35


Quote:> I am having problems in printing in Lanscape. At the
> moment all I am trying to do is
> draw a rectangle arround the printable area on the
> printer. Unfortunately the result is
> only part of the rectangle is printed in the upper left
> corner of the page and the rest is cut.

> Here is a copy of the code that does this. Can anyone see
> what is wrong?

<snip>

Http://www.mvps.org/EDais/DotNet/
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: Http://www20.brinkster.com/EDais/



 
 
 

1. Lanscape/terrain

Hi,

I've figured out how to use a height field in POV-Ray to generate a 3d
landscape, but is there any way to go further, such as adding trees,
buildings, etc.?

Thanks.

2. Summary: Why different costs via Unisys and CompuServe

3. Lanscape Generation

4. Looking to purchase a STB video rage card!!!

5. Fractal Lanscapes.

6. image of rocky lanscape?...

7. voxels, Lanscapes, and Direct X?

8. tracking vehicles on a 3d lanscape?

9. Lanscape!

10. 2d map -> 3d lanscape

11. Portrait vs Lanscape