|
-
Jun 30th, 2008, 10:21 AM
#1
Thread Starter
Addicted Member
[RESOLVED] e.HasMorePages don't work
Hi,
Can someone tell me why the e.HasMorePages = True in the code below don't work
I need to print the word Aetek in a new page.
Code:
Private Sub PrintDocument1_PrintPage...
e.Graphics.DrawString("Makor", DrawFont, DrawBrush, x, y, RTL_Alignment)
e.HasMorePages = True
e.Graphics.DrawString("Aetek", DrawFont, DrawBrush, x, y, RTL_Alignment)
e.HasMorePages = False
End Sub
Thanks in advance
-
Jun 30th, 2008, 10:43 AM
#2
Re: e.HasMorePages don't work
You need to have a global variable to tell the PrintPage event handler what to print on each page...
Some thing like this
Code:
Private printItem As Integer '<<< the global variable
'And when you call printdocument.Print, you do this
printItem = 0
PrintDocument1.Print()
'And then in your printpage sub, you check that global variable
Private Sub PrintDocument1_PrintPage...
If printItem = 0 Then
e.Graphics.DrawString("Makor", DrawFont, DrawBrush, x, y, RTL_Alignment)
printItem += 1 '<<< Increment the printItem variable
e.HasMorePages = True
Else
e.Graphics.DrawString("Aetek", DrawFont, DrawBrush, x, y, RTL_Alignment)
e.HasMorePages = False
End If
End Sub
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Jun 30th, 2008, 11:28 AM
#3
Thread Starter
Addicted Member
Re: e.HasMorePages don't work
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|