vb.net Code:
Private pageIndex As Integer = 0
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, _
ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
'Get the image to be printed.
Dim imageToPrint As Image = myTiff.Pages(Me.pageIndex)
'Print the image here.
'Increment the page index.
Me.pageIndex += 1
'There are no more pages to print if the index has gone beyond the upper bound.
e.HasMorePages = (Me.pageIndex < myTiff.Pages.Count)
If Not e.HasMorePages Then
'Reset the page index for the next run.
Me.pageIndex = 0
End If
End Sub
Note that that is almost certainly not valid code, but hopefully it illustrates the point.