Question Help needed with printing

macvic211

Member
Joined
Oct 31, 2009
Messages
6
Location
Wales
Programming Experience
Beginner
Hi
I need some help please as I am new to programming
I am trying to make a program which will contain pages with graphics on them and be viewed in a picture box. What I need help with is: Printing the picture box contents, when the files will be contained in the program as rescources
Please be gentle as I am trying to learn
 
Add a PrintDocument component and doubleclick it to generate the PrintPage handler, add this code:
VB.NET:
e.Graphics.DrawImage(Me.ThePictureBox.Image, e.MarginBounds)
Use the Print method to print the PrintDocument.

Explore the possibilities of this and the other printing components in Printing area of Toolbox.
Windows Forms Print Support
 
Thanks for the quick reply. I have tried your recommendation, but I keep getting errors as I am unsure what to put in the button click event. I have only previously been able to print from a known file location on the C: drive and can't figure out how to print from a picture box. As I have mentioned I am a complete beginner and appreciate any help given!!
 
I am unsure what to put in the button click event.
When I said to use the Print method of PrintDocument to print the document this is what I meant:
VB.NET:
PrintDocument1.Print()
 
Back
Top