robertlbryant
New member
I have been struggling with printing multiple pages from a list box. It seems to go fine for a page, but then the index seems to reset to 0 when I step through with the debugger, causing each page to be an exact copy of the first page. Can anyone spot why this would happen in my loop?
VB.NET:
Do
strPrintLine = CStr(lstGames.Items(intListIndex))
e.Graphics.DrawString(strPrintLine, fntPrintFont, _
Brushes.Black, sngPrintX, sngPrintY)
sngPrintY += sngLineHeight
intListIndex += 1
If sngPrintY > e.PageBounds.Bottom - 40 Then
If page < numPages Then
e.HasMorePages = True
page += 1
Return
Else
e.HasMorePages = False
Return
End If
End If
Loop Until intListIndex = intGamesMax