Guest Cheung Posted August 15, 2002 Posted August 15, 2002 Hi all, I encountered the following problem: When I previewed/printed a document using the following code, it worked fine when my default printer is a laser printer. However, it threw an exception when my default printer was set to a dot matrix printer "Epson LQ-850". I used the following code: Public Function PreviewFunction( ....... ) As Boolean ........................ myPrintDocu = New PrintDocument() myPreviewDocu = New PrintPreviewDialog() Try AddHandler myPrintDocu.PrintPage, AddressOf PrintText myPrintDocu.DefaultPageSettings = printPageSettings myPreviewDocu.Document = myPrintDocu msgbox(" it is now here!!!") myPreviewDocu.ShowDialog() Catch ex As Exception MessageBox.Show(ex.Message) End Try End Function public Function PrintText(ByVal sender As Object, ByVal e As PrintPageEventArgs) msgbox("it is now inside PrintText") ............................. End Function When the printer was the dot matrix one and when the previewFunction was called, the message "it is now here!!!" was printed. After that, an exception was thrown and the msgbox in the PrintText function didn't reach. If you know what happened, can you pls let me know. Thank you. Quote
Guest Cheung Posted August 15, 2002 Posted August 15, 2002 wrong question... I found that the problem was not due to the printers. It was due to the platforms. I wrote the program on NT. and when I ran this on a Win98 (of course with dotframework installed), the exception threw. any idea? Thanks and Regards. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.