For examle I want to print every 45 record on each new page.
Please Rewrite the following code in correct manner.
I dont know where to place HasmorePages=true and HasmorePages=false
Expand|Select|Wrap|Line Numbers
- Private Sub Pr_PrintReg(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles pr.PrintPage
- Dim gr As Graphics = e.Graphics
- Dim i As Int32
- For i = 1 To 200
- If i Mod 45 = 0 Then e.HasMorePages = True
- gr.DrawString(i.ToString + " Square is - " + (i ^ 2).ToString, New Font("arial", 12), Brushes.Black, 100, (i Mod 45) * 25 + 50)
- Next
- e.HasMorePages = False
- End sub