Print Preview Problems

P

Pete Vickers [MVP]

Hi,
I have migrated a Vb.Net project from VS2003 to Vs2005. I use a print
preview control, and in the 2003 project, i sent it a new print, and it was
displayed. In 2005, the first print sent is the only one that is ever
displayed. I have debugged the code, and the print I am sending is correct,
but the first print I sent still gets displayed. I have printed the docs,
and the correct docs print :(

My code is...
PrintDoc = New Printing.PrintDocument
PrintDoc.DefaultPageSettings.Landscape = _
(Layout = PrintOrientation.Landscape)
PrintDoc.DocumentName = Title


If PVOption = PrintPreview.Preview Then
Dim pkCustomSize1 As New Printing.PaperSize("Custom Paper
Size", 300, (miNL * 14) + 500)
PrintDoc.DefaultPageSettings.PaperSize = pkCustomSize1
ppv.Document = PrintDoc
pkCustomSize1 = Nothing
.....

If I set the printer, and do a 'printdoc.print' then the correct output is
printed - just not previewed?

Any ideas?

thanks

Pete
 
P

Pete Vickers [MVP]

Hi,
to answer my own question

ppv.InvalidatePreview()

after
ppv.Document = PrintDoc

May be usefule for someone in the future

Pete
 

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