Ciao ragazzi, ho fatto questa semplice prova per utilizzare printdocument, tutto bene a parte il fatto che non riesco a fargli stampare le 3 pagine come dovrebbe. Dove sbaglio?

[

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage

Dim old As Integer = 0

For t = 1 To 3
Dim y As Integer = 1


For x = t * 100 To t * 100 + 20



e.Graphics.DrawString(x, Font1, Brushes.Black, 200, y)
y = y + 20


If y = 20 Then y = 0
Next

If t > old Then
e.HasMorePages = True
Else
e.HasMorePages = False
End If


old = t
Next

End Sub

]