1

we have a windows form application trying to do regular printouts.

Clients are complaining with popup coming up while we do multiple print outs saying printing page 1 of document. ( i guess im not allowed to post pictures, i dont have the reputation, so here is the screenshot)

Is there a way to hide these. or should we be using a different method. Thank you.

Function Print()
    Dim prn As New Printing.PrintDocument
    Using (prn)
        prn.PrinterSettings.PrinterName = sPrnName
        prn.PrinterSettings.Copies = 1
        AddHandler prn.PrintPage, AddressOf Me.PrintPageHandler
        prn.Print()
        RemoveHandler prn.PrintPage, AddressOf Me.PrintPageHandler
    End Using


End Sub



Private Sub PrintPageHandler(ByVal sender As Object, _
   ByVal args As Printing.PrintPageEventArgs)
    Dim myFont As New Font("Courier New", 9)
    args.Graphics.DrawString(_sPrnRows, _
       New Font(myFont, FontStyle.Bold), _
       Brushes.Black, 5, 5)
End Sub
drewex
  • 317
  • 3
  • 13
  • I'm not aware of a way to prevent those dialogues being displayed but you can make them more meaningful by setting the `DocumentName` property of the `PrintDocument`. It will then display your document name instead of just "document". – jmcilhinney Sep 25 '14 at 01:51
  • They are insistent on removing them or hiding them. There must be away to show them behind application screen. – drewex Sep 25 '14 at 02:53
  • http://stackoverflow.com/questions/10572420/how-to-skip-the-dialog-of-printing-in-printdocument-print-and-print-page-direc – albert Sep 25 '14 at 08:32

1 Answers1

1

The answer is from question albert found. prn.PrintController = new System.Drawing.Printing.StandardPrintController()

drewex
  • 317
  • 3
  • 13