Click here to Skip to main content
16,015,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Windows form that contains 20 images. 2 across and 10 down. I think I have written the proper code, however the 15th and 16th images come cut off (approx 3/4 down the page) and the last 4 images never show on the print. I'm sure its something silly but I have been at this for 3 days and cannot think correctly anymore.

This is the layout on the form:

(Image 1) (Image 2)
(Image 3) (Image 4)
(Image 5) (Image 6)

etc.

VB
Dim MyMargins As New Printing.Margins
      With MyMargins
          .Left = 0
          .Right = 0
          .Top = 0
          .Bottom = 0
      End With


      Form2.PrintForm1.PrinterSettings.DefaultPageSettings.Margins = MyMargins

      Form2.PrintForm1.Print(Form2, _
          PowerPacks.Printing.PrintForm.PrintOption.Scrollable)


From what I have read the "PrintOption.Scrollable" will allow the printer to print the whole form (including the images (controls) that are not physically seen by the user (anything out of focus())

I have noticed some improvement. Originally I was only able to print 10 images on a page. Now after using "PrintOption.Scrollable" I am up to 14 whole images.
Each Image size is: 296, 94

Also, after using the "PrintOption.Scrollable" code any TextBoxes that I had on top of the image will not show on the printed sheet of paper.

I tried
VB
Form2.PictureBox1.SendToBack()

before I called the print code, but that did not make a difference at all..

Any help would be appreciated. Thanks in advance!!
Posted
Updated 4-Jan-15 11:22am
v3

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