VB.NET

Moderators: seancampbell
Number of threads: 4022
Number of posts: 10035

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
printing causes form to close Posted by apenticoff on 30 Nov 2006 at 2:57 PM
I have a strange error. When I print to a printer, it causes the form to close.

here is the code:

Private Sub PrintALabel()

Me.printdoc = New PrintDocument
Me.printdoc.Print() ' This line cause the form to close

End Sub
Private Sub printdoc_printpage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) _
Handles printdoc.PrintPage


Dim XDate As Date = Now()
Dim pfont12 As Font = New Font("Arial", 12)
Dim pfont10 As Font = New Font("Arial", 10)


commenting out the Me.printdoc.Print line makes the form stay open but nothing prints naturally.
Anyone know what causes this behavior, and how to prevent it?

Thanks, Art
Thread Tree
apenticoff printing causes form to close on 30 Nov 2006 at 2:57 PM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.