Prints OK but PrintPreview Shows Only a Blanik Page

E

eBob.com

I have a print application modeled on a program which I found via this
newsgroup. (I still have comments in German in it!) The model uses
ExtendedPrintPreviewDialog but I don't seem to have that so I am using
PrintPreviewDialog.

It prints fine. But the PrintPreview dialog shows only one blank page.
Before I resort to posting code, is there some simple and/or common mistake
I could have made which would explain why PrintPreview shows me only one
blank page?

Thanks, Bob
 
R

rowe_newsgroups

I have a print application modeled on a program which I found via this
newsgroup. (I still have comments in German in it!) The model uses
ExtendedPrintPreviewDialog but I don't seem to have that so I am using
PrintPreviewDialog.

It prints fine. But the PrintPreview dialog shows only one blank page.
Before I resort to posting code, is there some simple and/or common mistake
I could have made which would explain why PrintPreview shows me only one
blank page?

Thanks, Bob

Sample code?

Thanks,

Seth Rowe
 
E

eBob.com

After some experimentation I now have working code. For the benefit of
anyone else who might someday make the same mistakes I did, here's what
resolved my problem(s).

I had started with code modeled on some code which I found in Petzold. In
that code he used AddHandler to establish his PrintPage routine. In my code
that AddHandler statement ended up in the code for the Print menu item. So
the AddHandler was not being executed until the first time I actually
printed. However, in my original code PrintPreview was showing me only a
blank page even after actually printing. Part of my experimentation was to
replace the Petzold code for determining the printable area of the page with
some code from a Microsoflt sample which looks equivalent. So MAYBE there
was something in the way the Petzold code was determining the printable area
of the page which worked fine for my printer but didn't work so well for
PrintPreview. (I have my doubts, but that's the only explanation I can come
up with.)

The Microsoft sample which helped me to resolve my problem(s) is called
"How- To Do Simple Printing". Well ... that's the name of the directory on
my hard drive in which I found it - but I didn't make that name up. I can't
be sure now where I found it, but I'd guess here ...
http://www.microsoft.com/downloads/...c1-32ad-4d7f-9d6d-89b0e2d55c2f&DisplayLang=en

Thanks Seth for your response. And Good Luck to anyone who stumbles upon
this while researching PrintPreview problems.

Bob
 

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