K
Kyle Walz
I'm working on an app where each page is a like a form (not Windows
form) with a set format. Using MSVB.NET 2003 with 1.1 framework.
Here's some code:
Private Sub PrintText(ByVal sender As Object, ByVal ev As
PrintPageEventArgs)
Dim brush As Brush = New SolidBrush(Color.Black)
Dim font As Font = New Font("Arial", 10, FontStyle.Regular)
' first page
ev.Graphics.DrawString(Label1.Text, font, brush, 60, 60)
ev.Graphics.DrawString(TextBox1.Text, font, brush, 420, 60)
' etc...
ev.Graphics.DrawString(Label37.Text, font, brush, 60, 840)
ev.Graphics.DrawString(TextBox36.Text, font, brush, 420, 840)
' tried a few different things here, I know this doesn't work
ev.HasMorePages = False
ev.HasMorePages = True
' second page
ev.Graphics.DrawString(Label40.Text, font, brush, 280, 60)
ev.Graphics.DrawString(Label41.Text, font, brush, 480, 60)
' etc...
ev.Graphics.DrawString(TextBox49.Text, font, brush, 280, 570)
ev.Graphics.DrawString(Label54.Text, font, brush, 480, 570)
ev.HasMorePages = False
End Sub
Each page is different with various column-n-row setups. Looking for
a way to say "next page" and keep marching to a new page's format.
Thanks for any help.
Kyle
form) with a set format. Using MSVB.NET 2003 with 1.1 framework.
Here's some code:
Private Sub PrintText(ByVal sender As Object, ByVal ev As
PrintPageEventArgs)
Dim brush As Brush = New SolidBrush(Color.Black)
Dim font As Font = New Font("Arial", 10, FontStyle.Regular)
' first page
ev.Graphics.DrawString(Label1.Text, font, brush, 60, 60)
ev.Graphics.DrawString(TextBox1.Text, font, brush, 420, 60)
' etc...
ev.Graphics.DrawString(Label37.Text, font, brush, 60, 840)
ev.Graphics.DrawString(TextBox36.Text, font, brush, 420, 840)
' tried a few different things here, I know this doesn't work
ev.HasMorePages = False
ev.HasMorePages = True
' second page
ev.Graphics.DrawString(Label40.Text, font, brush, 280, 60)
ev.Graphics.DrawString(Label41.Text, font, brush, 480, 60)
' etc...
ev.Graphics.DrawString(TextBox49.Text, font, brush, 280, 570)
ev.Graphics.DrawString(Label54.Text, font, brush, 480, 570)
ev.HasMorePages = False
End Sub
Each page is different with various column-n-row setups. Looking for
a way to say "next page" and keep marching to a new page's format.
Thanks for any help.
Kyle