Hello,
I've a little problem:
and the PrintDocument_PrintPage:
Now, printing works fine... the first time. If I repeat printing, the printHeader is skipped: page <> 0, because it isn't re-initialized![Mad :mad: :mad:](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Why the static vars aren't re-initialized when I start a new printing? How fix it?
Thanks
I've a little problem:
VB.NET:
If PrintDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
PrintDocument1.PrinterSettings = PrintDialog1.PrinterSettings
AddHandler PrintDocument1.PrintPage, AddressOf PrintDocument_PrintPage
PrintDocument1.DocumentName = "---"
PrintDocument1.Print()
End If
and the PrintDocument_PrintPage:
VB.NET:
e.Graphics.RenderingOrigin = New Point(e.MarginBounds.Left, e.MarginBounds.Top)
Dim Font As New Font("Arial", 10, FontStyle.Regular)
Dim CharHeight As Single = Font.GetHeight(e.Graphics)
Dim Y As Int16 = e.MarginBounds.Top
Static page As Integer = 0
...
if page = 0 Then
printHeader(e)
end if
...
if e.HasMorePage Then
page += 1
end if
Now, printing works fine... the first time. If I repeat printing, the printHeader is skipped: page <> 0, because it isn't re-initialized
Why the static vars aren't re-initialized when I start a new printing? How fix it?
Thanks