how to set the printer orientation?

rangasamy_v

New member
Joined
Aug 30, 2010
Messages
3
Programming Experience
5-10
Hi all,


i need to set the prineter orientation in VB.NET how to do this?

Is there any codes?


Thanks!
 
You can set the PageSettings.Landscape to True by creating your own PageSettings and assigning it to the PrintDocument:
VB.NET:
YourPrintDocument.DefaultPageSettings = New PageSettings With {.Landscape = True}
Or you can set it in the PrintPage event:
VB.NET:
Private Sub YourPrintDocument_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles YourPrintDocument.PrintPage
    e.PageSettings.Landscape = True/False
End Sub
 
Back
Top