How to fill a A4 page when printing a form?

How can I fill a entiry A4 page, when using Pintform I have a picturebox docked in the form, with a model of a report, and some textbox, that fill some questions of the report.

But I can't get the picturebox to completely fill the printed page. Is there any tool that could help me

Thanks,

Lucas



Answer this question

How to fill a A4 page when printing a form?

  • Scuzzy

    Dear Jonathan,

    Thanks for your answer, but I am using a PrintForm, because I have some textbox in the same form, that have to be printed together.

    Using the PrintDocument is quite boring when you have too many itens to add to your printing. So, I would like to do it wih the PrintForm.

    Adjusting the size of the form, doesn't help me, because there is a maximum size, that isn't enough to fill up a A4 page.


  • lwfoon

    Alas, PrintForm doesn't really offer the control you need. Even back in the old days, it never was meant for more than a quick and dirty hack.

    Jonathan


  • helpmeplz

    1. Add a PrintDocument control to your form.

    2. Add this code:

    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
    e.Graphics.DrawImage(Me.PictureBox1.Image, 0, 0, e.PageBounds.Width, e.PageBounds.Height)
    End Sub

    3. Add A PrintDialog control

    4. Set to the Document property of contol the print dialog to the Print Document

    5. Add this code to a button:

    If Me.PrintDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
    PrintDocument1.Print()
    End If


  • How to fill a A4 page when printing a form?