Results 1 to 3 of 3

Thread: [2008] Print Document always close the Application

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2004
    Location
    Jakarta, Indonesia
    Posts
    818

    [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?

    1st NF - a table should not contain repeating groups.
    2nd NF - any fields that do not depend fully on the primary key should be moved to another table.
    3rd NF - there should be no dependency between non key fields in same table.
    - E. Petroutsos -


    eRiCk

    A collection of "Laku-abis" Ebook, Permanent Residence

    Access Reserved Words, a Classic Form Bug, Access Limitation, Know run Process and the Lock they hold in, Logging User Activity in MSSQL,
    Kill Database Processes

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2008] Print Document always close the Application

    Post the code you are using to do the printing.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2004
    Location
    Jakarta, Indonesia
    Posts
    818

    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

    1st NF - a table should not contain repeating groups.
    2nd NF - any fields that do not depend fully on the primary key should be moved to another table.
    3rd NF - there should be no dependency between non key fields in same table.
    - E. Petroutsos -


    eRiCk

    A collection of "Laku-abis" Ebook, Permanent Residence

    Access Reserved Words, a Classic Form Bug, Access Limitation, Know run Process and the Lock they hold in, Logging User Activity in MSSQL,
    Kill Database Processes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width