Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
What is the essential code in making printdocument? Because I want to print all labels,textbox, and picturebox inside the form1
Posted 2-Mar-12 4:27am
renc459
Comments
SAKryukov at 2-Mar-12 9:34am
   
And where is you MDSN, broken?
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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[^]
  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 2 Mar 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100