* " Just Me" <ne********@a-znet.com> scripsit:
Just don't print the page. How to prevent printing strongly depends on
how you handle printing of the pages.
Not sure what you mean. I now in PrintPage only bump my page number variable
and exit.
But the system must consider the fact that PrintPage is entered its a page
(I guess a blank one, I never checked).
Unless someone knows how to tell the system not to add a page to the print
document I'll have to try do it all in QueryPageSettings (but that's not
without a problem). I wish I could in QueryPageSettings or in PrintPage tell
the system not to add this page to the output.
To illustrate the problem think of a 10 page document. For each page, in
QueryPageSettings I ask the user if he want to print the page. Say he does
for the first 9 pages but on page 10 he says not to print page 10. I don't
know what to do. As soon as I exit, PrintPage will get called and if I do
nothing in PrintPage a blank page gets added to the document.
In 'PrintPage', you can do something like that:
\\\
Private m_NextPageToPrint As Integer
Private Sub MyPrintDocument_PrintPage(...) Handles ...
Select Case m_NextPageToPrint
Case 1
e.Graphics.DrawString(...)
Case 2
e.Graphics.DrawString(...)
Case 3
...
Case 4
...
End Select
e.HasMorePages = ShouldNextPageBePrinted(...)
End Sub
Private Function ShouldNextPageBePrinted(...) As Boolean
If ... Then
...
m_NextPageToPrint = 4
...
Return True
Else
Return False
End If
End Function
///
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>