wildfire1982 Posted December 15, 2003 Posted December 15, 2003 Hello, is there any way to call the printpreviewdialogs code? or below you can see basically what i need to do. I just cant pass the system.drawing.printing.printPageEventArgs reference. I need to pass it on to be able to call it. Any suggestions? PrintDocument1_printpage(Me, Printing.PrintPageEventArgs) The reason i ask is that im trying to print a picture and i can get the printer to print but i just cant get it to drawImage. Cheers Quote Chris
Voca Posted December 16, 2003 Posted December 16, 2003 (edited) Hi wildfire, this is some code of mine (excerpt) I hope this helps a little bit: Protected oPrintPreDlg as New PrintPreviewDialog Protected oProntDoc as New PrintDocument ... oPrintPreDlg.Document = oPrintDoc 'What to print in printpreview oPrintPreDlg.ShowDialog() 'oPrintDoc.Print() 'Would print the document to the printer ... Private Sub oPrintDoc_Printpage(sender as Object, e as system.drawing.PrintEventargs)... ... e.Graphics.DrawLine(...) e.Graphics.DrawString("SomeText",...) ... End Sub You just need to define your printdocument-object. Printpage is the Event where you can define what to print. You do not need to define any PrintPageEventArgs or something like that. In the example I'd just draw a line and some text. There are also Methods for drawing images or whatever you want. Any further questions, just ask Voca Edited December 16, 2003 by Voca 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.