Click here to Skip to main content
15,915,501 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi.. Dear all

I have a problem to increase windows form height, actually I want to print windows form but my windows form real height around 900 and image is printed successfully but bottom portion is cut out then how can manage this bottom portion.
please guys help me..

Thanks in advance..
Posted

You can always make the windows height beyond the screen size programmatically, but this is not a right approach.

The right approach would be this: don't print a window, print a document. This way, you decouple the document from its window. The workflow should be this: a document is relatively independent from the presentation: it goes to the window in one situation, to the printer in another one. Of course, the features are different: on a window, it usually can be edited.

Here is how it perfectly lies into this conception is you use the class System.Drawing.Printing.PrintDocument:
http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx[^].

Pay attention for the code sample.

Good luck,
—SA
 
Share this answer
 
Comments
VJ Reddy 26-Apr-12 13:31pm    
Good answer. 5!
What is given in your solution is absolutely correct.
I thought that the Form was being printed to check for the design of the Form and not for printing the actual contents while running the program. Of course, there is no indication in this regard in the question, but somehow, I had that feeling. Even other wise if the form is more than the screen size I think it is preferable to redesign the form using Tabs or other suitable control, by arranging the controls into logical groups,which would reduce the clutter and will not deviate the attention of the user.
Thank you.
Sergey Alexandrovich Kryukov 26-Apr-12 13:40pm    
Yes, I understand that. And I agree that the redesign of the structure could help, but I think the idea to works with things as with a document should come first; at least for most applications.
Thank you, VJ.
--SA
Monjurul Habib 27-Apr-12 3:16am    
5!
Sergey Alexandrovich Kryukov 27-Apr-12 10:09am    
Thank you, Monjurul.
--SA
If it is required to print the displayed form whose height is more than the screen resolution, then I think the screen resolution can be increased to fit the form.

Second option is to capture the top and bottom parts of the Form separately using a screen capture tool like
http://cropper.codeplex.com/[^]
and to join the two parts in paint or other image processing software.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Apr-12 13:21pm    
I voted 4 for the interesting and useful link and the correct idea that the size can be increased (in first sentence), but I cannot agree that these are the best solutions.

Please see my answer -- this is what I think.
Thank you.
--SA
VJ Reddy 26-Apr-12 13:32pm    
Thank you, SA.

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