|
-
Jun 20th, 2008, 04:21 AM
#1
Thread Starter
Fanatic Member
[2008] Print Document always close the Application
i got 2 form, first is MainForm and the other are PrintForm
at the MainForm it called the PrintForm then it populate some date in the PrintForm, after that user choose to print..the printing is done but after that the Application is close
why this happened?
-
Jun 20th, 2008, 07:18 AM
#2
Re: [2008] Print Document always close the Application
Post the code you are using to do the printing.
-
Jun 21st, 2008, 12:40 AM
#3
Thread Starter
Fanatic Member
Re: [2008] Print Document always close the Application
i use this line of code
Code:
Dim oPrintDocument As New PrintDocument
AddHandler oPrintDocument.PrintPage, AddressOf PrintDocument_PrintPage
oPrintDocument.Print()
Private Sub PrintDocument_PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
' Create string to draw.
Dim drawString As String = ""
If isPrintBatch = True Then
drawString = BATCH_TO_PRINT
ElseIf isPrintBatch = False Then
drawString = SERIAL_TO_PRINT
End If
' Create font and brush.
Dim drawFont As New Font("10 point monospace standard", 4.38)
Dim drawBrush As New SolidBrush(Color.Black)
' Create point for upper-left corner of drawing.
Dim drawPoint As New PointF(0.0F, 0.0F)
' Draw string to screen.
ev.Graphics.DrawString(drawString, drawFont, drawBrush, drawPoint, New StringFormat())
End Sub ' PrintDocument_PrintPage
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
|