Cannot Alter PrintDialog Settings Programatically

L

Lee Ottaway

Oh boy, I really need help with this one. I've been working on it for
days and have gotten nowhere. The department I'm contracting for have
just purchased a very nice and highly expensive HP Laserjet 5500n
colour laser printer, solely so that I could print easily from VB.NET.
My problem is I cannot seem to change the print settings for the
print dialogue programatically. For example, most of the prints
require a landscape format. I've tried:

pd.DefaultPageSettings.Landscape = True

and

pd.PrinterSettings.DefaultPageSettings.Landscape = True

where pd is a PrintDocument class of course. I then attach the print
document to the print dialogue using pDlg.Document = pd and voila! the
print dialogue tells me it's in portrait mode. Similarly I can't
change the page size or indeed anything else in the dialogue.

The PrintDocument default page settings ARE changing before I show the
print dialogue because I've tested the variables, but the print
dialogue seems to set them back to a basic portrait format. Is it a
setting within the printer that could be causing this or what? I've
looked avidly throughout the newsgroups for anyone who's had a similar
problem, but I somehow seem to be the only one in the world!

Does anyone have any ideas???
 
S

Sijin Joseph

That should actually work, can you post actual code so that the problem can
be reproduced.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top