mbmsit
mbmsit

Reputation: 63

C# Print long height form with printform component

How can i print a form that has height more than screen height (form has vertical scroll)?

Upvotes: 0

Views: 630

Answers (1)

Hans Passant
Hans Passant

Reputation: 942328

PrintForm only supports printing an exact copy of what you see on the screen. The print-out will have a visible scrollbar as well. And of course not show the controls that are scrolled out of view.

There's an excellent workaround for this, use the PrintDocument component. The print-out will look much better as well, not the grainy bitmap you get out of PrintForm. You do however have to write the code for the PrintPage event handler yourself. A fair amount of code, but it isn't hard code. Use PrintPreviewDialog so that you don't waste a tree debugging and fine-tuning your code.

Upvotes: 1

Related Questions