Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to make the Form1 of A4 size and then print the contents present on the form .

how do i print all the contents of the form , even the part which is not visible ( i.e visible after scrolling the form )

thanks pending......
Posted

Here's one solution in VB[^], but you can modify, etc.

I've also used the PrintPreview[^] control in combination with PrintDocument[^] and PageSetupDialog[^] to let the user select the paper size, but you can just set the size without the dialog if you are certain that the paper is available, etc.

For Code conversion
Convert VB.NET to C#[^]
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 16-Jul-11 0:32am    
Good answer, my 5. I only added one general note in my solution, please see.
--SA
Printing a form is not a very good conception. You need to print data on a form from your data layer that is recommended to have, hence PrintDocument (http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument%28v=vs.71%29.aspx[^]) provides a good flexible solution.

—SA
 
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