PrintPageEventArgs.HasMorePages [Resolved]
I wish to make a program that can print multiple pages.
I try to implement PrintPageEventArgs.HasMorePages.
I follow its example from MSDN help page at:
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfSystemDrawingPrintingPrintPageEventArgsClassHasMorePagesTopic.htm
For example, I want to print text "ABC" on 3 pages.
This is the code I have written:
Code:
Private Sub PrintDocument_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument.PrintPage
Dim intCounter As Integer
For intCounter = 0 To 3
e.Graphics.DrawString("ABC", New Font("Courier New", 10, FontStyle.Bold), Brushes.Black, 165, 158)
If intCounter < 3 Then
e.HasMorePages = True
MessageBox.Show("True")
Else
e.HasMorePages = False
MessageBox.Show("False")
End If
Next
End Sub
But after printing the first page, it just stop printing 2nd and 3rd page. Why? is there any mistake in my code?
Please guide me thank you!