PrintForm in VB 2005 Express

sirmilt

Member
Joined
Dec 14, 2006
Messages
17
Programming Experience
1-3
I added a PrintForm component and it simplified printing of a form greatly. However, I can't figure out how to change from Portrait(the default) to Landscape.

This one line of code prints the form in Portrait:
pf.Print '(pf is the name I gave to the Printform control)

Thanks,
 
VB.NET:
[SIZE=2]pf.PrinterSettings.DefaultPageSettings.Landscape = [/SIZE][SIZE=2][COLOR=#0000ff]True[/COLOR][/SIZE]
 
John H

Thank you, your code example solved my problem. I'll bet that I spent two hours this morning trying various combinations and none worked until I tried your suggestion.
 
Hi Again:

Here's another piece of the same problem that JohnH helped me with earlier.
The lansdcape works fine but when I try to add margins, it has no effect.

Here's my code:

pf.PrinterSettings.DefaultPageSettings.Margins.Top = 0.6
pf.PrinterSettings.DefaultPageSettings.Margins.Left = 1.25
pf.PrinterSettings.DefaultPageSettings.Landscape =
True
pf.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable)

The form prints, the landcape orientation works but the Margins are ignored and I get no error message. Obviously I'm missing something and the Help files do not help.
 
Back
Top