Print Form - Non Visible Area

poets

Member
Joined
May 22, 2006
Messages
9
Programming Experience
Beginner
Hello,

please help. how should I do if I want to print the winform ?
I have found plenty of solutions usualy using PrintScreen method but this does not solve the problem if the form is bigger then the screen.

Thanks for any comment :D
 
The number of people who ask how to print a form when they actually have no need of printing the entire form is very large. Do you genuinely want to print an image of the form, with all the fancy graphics, or do you actually just want to print the data that your form contains, like the vast majority of applications do? I've never used an application that actually prints an exact visual representation of a form because it's rarely needed. Even most good Web sites have a printer-friendly version that removes all the unnecessary stuff.
 
To be honest my experiences with printing in VB.net are infitesimal.
Now I face the fact that I need to print the prepared purchase order form that contains the company logo and some richboxes filled from sql.
Unfortunately I did not found better solution then to print the form as I need to combine the text from sql and graphics. I also want to allow the user to change contents before final printing.
Thanks for any comment
 
You definitely shouldn't be printing the form itself then. Let's say that the text in your RichTextBox is too long to fit in the control without scrolling. Printing the form will only print what is visible in the control at the time.

Printing in .NET is very powerful and flexible. You should download the 2003 101 Samples from Microsoft (see my signature for a link). It can be opened in 2005 and includes a printing example. It just prints basic text but the principle is exactly the same whatever you want to print. You just have to call the appropriate methods of the Graphics class, e.g. DrawString, DrawImage, DrawLine, etc.
 
Thanks !

Thanks a lot ! I found what I was looking for. Seems to be working even I have to spend some time to understand this.
 
Back
Top