Click here to Skip to main content
15,896,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a Windows form (in VB) which prints onto A4 paper using PrintForm and PowerPacks.Printing.PrintForm.PrintOption.ClientAreaOnly. This works fine when my laptop is connected to my 24 inch monitor but when I disconnect it I discovered that when I printed it cut the bottom of the form off. It looks like the PrintForm only prints up to the total height of the screen, and as my laptop resolution is lower it cuts off.

The form has various items on (buttons, images, tables etc) which are all high up on the form so print correctly but I have a 'footer' at the bottom which is getting cut off on the lower resolution. It may be that changing the resolution resizes the form on screen which is the cause of the bottom getting cut off? Is it possible to have a form larger that the screen height (scrolling for example)

I've seen a couple of methods which people say may resolve this but not sure which one would be best for this problem. Anybody got any ideas?

Thanks
Garry
Posted
Comments
Sergey Alexandrovich Kryukov 11-Mar-14 19:19pm    
Resolution is irrelevant. What you call screen resolution is the size of the screen in pixels, which certainly can effect your print size. But you should resist it. :-)
—SA

The best solution is to stop using PrintForm and to use a PrintDocument[^] instead.
It allows you to specify the layout in a screen independent manner, and decide how everything looks regardless of screen resolution. It's more work, but it produces much better results.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-Mar-14 19:20pm    
For sure, a 5.
—SA
Thanks for the reply Griff.

Just to double check this is the best method, my form contains a table, buttons and a picture box plus several labels and text boxes. Would I add the PrintDocument to my form and then specify the location of each item on the page when the 'print' button is clicked using the e.Graphics.DrawString(object, etc)?

Thanks
Garry
 
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