I am now unable to edit my prior post so here is an update.
Here is a simpler version of code that I would like to have print 1 line on a new page for ten pages.
Unfortunately all I get is the text overwriting all on the first page.
Can anyone tell me what I am doing wrong or right?
How do I get a clean blank page to print new data?
Here is a simpler version of code that I would like to have print 1 line on a new page for ten pages.
Unfortunately all I get is the text overwriting all on the first page.
Code:
Option Explicit On
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub btnPrint_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles _
btnPrint.Click
PrintPreviewDialog1.ShowDialog()
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, _
ByVal e As System.Drawing.Printing.PrintPageEventArgs) _
Handles PrintDocument1.PrintPage
Dim i As Integer
For i = 0 To 10
e.Graphics.DrawString("Line of Credit Chronology" & i, _
New Font("Microsoft Sans Serif", 14, FontStyle.Bold), _
Brushes.Black, 50, 75 )
If i < 10 Then
e.HasMorePages = True
Else
e.HasMorePages = False
End If
Next i
End Sub
End Class
Can anyone tell me what I am doing wrong or right?
How do I get a clean blank page to print new data?
Last edited by a moderator: