print scrollable form?

Turbols1

Member
Joined
Jan 25, 2010
Messages
13
Programming Experience
1-3
John, sorry to dig up an old thread print a form vb.net , but I have a question about the module you posted. How can I use the module you provided, but print an entire single page scrollable form without the form border?

I am unhappy with my current code which works, but doesnt offer the printer selection, it also prints off center and cuts off the bottom of the form on XP machines, but prints perfect on my Vista machine. Moral of the story is, I think your option is much better if I could print a scrollable form.

This is the code for the print menu object from main form, the form actually being printed is more of a preview window with a menubar across the top.
VB.NET:
Private Sub PrintCurrentFormToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintCurrentFormToolStripMenuItem.Click
        Form3.MenuStrip1.Visible = False
        Form3.PrintForm2.PrinterSettings.PrinterResolutions.Equals(1200)
        Form3.PrintForm2.Print(Form3, PowerPacks.Printing.PrintForm.PrintOption.Scrollable)
        Form3.MenuStrip1.Visible = True
    End Sub
 
Last edited by a moderator:
John, sorry to dig up an old thread "print a form vb.net", but I have a question about the module you posted. How can I use the module you provided, but print an entire single page scrollable form without the form border?
Old is old and things happen in many areas in 4 years. The first version of PrintForm component wasn't even released when that module was written. This is also several .Net frameworks ago. A code that relies on auto-pressing the PrintScreen keyboard button will only capture what you can see on screen at the time the button was pressed, same as actually pressing that button on your keyboard.

I wasn't aware the Powerpacks PrintForm component had a PrintOption.Scrollable option. I don't think you can specify aligment with that component.

For printing extended multi-page reports you should have a go with PrintDocument Class (System.Drawing.Printing). See also Windows Forms Print Support
 
When using the PrintDocument class, I cannot print the portion of the form that isnt in view (scrollable). So back to the PrintForm class, I read somewhere that any form or object on your form (picturebox) over 900 pixels tall will have all pixels over 900 cut-off when printing. Also, if the form/object is taller than your monitor in pixels, it will also be cut-off. This seems to be the problem...Trying to resize things now to make it work.
 
When using the PrintDocument class, I cannot print the portion of the form that isnt in view (scrollable).
With PrintDocument you are not limited to outputting screen dumps, using the Graphics methods (DrawString, DrawRectangle etc) the reporting possibilities are endless.
 
Back
Top