Printing from a form

cjohnson

Well-known member
Joined
Sep 21, 2006
Messages
63
Location
WV
Programming Experience
1-3
I have several applications where I would like the user to fill in some information on a form, let the form calculate some values, and then print the form as is on screen. Is there any easy way to do this, or any way I can program to print any form from one function?
Thanks,
Chris
 
Thanks. That is a big help.
By the way. I like your tagline. Did you also know...
There are 11 kinds of people in the world. Those who understand binary, and those who don't.
 
yup, it's cute, kind of like this one:
Windows is a set of 32 bit extensions on a 16 bit shell for an 8 bit OS using a 4 bit kernel made by a 2 bit company that can't stand 1 bit of competition.
 
I loved the PrintForm component from Microsoft. I like using this better than using a downloaded module, however, I am having one problem. I can set the page orientation, etc. but I can't set the margins. I tried setting them in the PrintForm.PrinterSettings.DefaultPageSettings, but no matter what I do, it prints in the top left corner at 0,0. I even tried something I saw online which was to set this in the Form_Load as shown below, but didn't help. Any ideas?
Thanks,
Chris

VB.NET:
Private Sub frmSimpleForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   Dim newMargins As System.Drawing.Printing.Margins
   newMargins = New System.Drawing.Printing.Margins(50, 50, 50, 50)
   Me.PrintForm1.PrinterSettings.DefaultPageSettings.Margins = newMargins
   Me.PrintForm1.PrinterSettings.DefaultPageSettings.Landscape = True
End Sub
 
Back
Top