Results 1 to 2 of 2

Thread: PrintPageEventArgs.HasMorePages [Resolved]

Threaded View

  1. #1

    Thread Starter
    Registered User
    Join Date
    Apr 2003
    Location
    Klang, Selangor, Malaysia
    Posts
    163

    Question 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!
    Last edited by albertlse; Aug 25th, 2003 at 04:04 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width