Click here to Skip to main content
15,881,742 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
What is the essential code in making printdocument? Because I want to print all labels,textbox, and picturebox inside the form1
Posted
Comments
Sergey Alexandrovich Kryukov 2-Mar-12 9:34am    
And where is you MDSN, broken?
--SA

How you could guess if you tried, the essential code sample is placed on exact same page as the MSDN documentation on this class:
http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx[^].

Good luck,
—SA
 
Share this answer
 
If you just want to print the form content (and I wouldn't, myself becasue it will look really ugly), you could use the PrintForm class: http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.powerpacks.printing.printform.aspx[^] - there is an example at the bottom.

If you use a PrintDocument, it is a little more complex, but there is an easy to follow example at the bootom of the class infor page in MSDN: http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900