ahayes1ic Posted October 1, 2003 Posted October 1, 2003 (edited) 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. 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? Edited October 1, 2003 by ahayes1ic Quote
*Gurus* divil Posted October 2, 2003 *Gurus* Posted October 2, 2003 You don't want to have a loop there, for a start. You'll have to keep a form-scoped variable around saying which number to print. Like you're doing now you'll write the text, then if i < 10 then tell it it has more pages. You'll have to manually increment it each time too. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.