Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have lots of labels in a form and it needs to scrolled. I have set its AutoScroll property to True. Now i am trying to print this form but only the visible part of the form is printed not the whole form. I used Visual Basic PowerPacks and set the PrintAction property to PrintToPrinter.

What I have tried:

VB
PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable)



VB.NET
PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.FullWindow)
Posted
Updated 23-May-16 21:02pm

1 solution

Don't use Printform - it can only print the visible part.
Instead, use a PrintDocument Class (System.Drawing.Printing)[^] and manually locate the label content onto the output. It allows you to specify everything about the print: font, size, number of pages you print it on, and so forth - so it's a lot more flexible, if more work that just dumping the form to the printer.
As usual, the link includes sample code.
 
Share this answer
 
Comments
Member 12178151 24-May-16 4:41am    
Thanks for the reply. Can you please provide some snippet how to use PrintDocument Class. As the example you provided is for the txt file. I need to print the whole form with the labels.
OriginalGriff 24-May-16 4:46am    
:sigh:
And what does a label contain?
Text.
So replace the text file with the label contents, and print them in the right place on the page...
I'm not here to do your work for you! :laugh:

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