-
Oct 23rd, 2020, 01:07 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Printing a Form
I am running VB6 on WIN10.
I found I can print a form using the following code
" Printer.Orientation = 2 'LANDSCAPE Printer.PrintQuality = vbPRPQHigh '-4
Printer.ColorMode = vbPRCMColor '2
Me.PrintForm
"
How can I center the form horizontally on the paper?
The data is already centered when displayed on the screen.
Also, all the 'text' (really label boxes are printing correctly except for one. The page title is printing with a larger font size. I need the original font size for screen display. Do I just change the font size temporarily for printing and then change it back?
Thanks
-
Oct 23rd, 2020, 05:01 PM
#2
Thread Starter
Fanatic Member
Re: Printing a Form
I have added the following code
"Printer.CurrentX = (Printer.Width - Me.Width) / 2"
I thought that I should center the form on the paper the same way you center the form on the screen. This didn't work. The results were the same. Could it be that units for Printer.width and me.width don't match.
I'm checking not to find out what the default units are.
-
Oct 23rd, 2020, 05:17 PM
#3
Re: Printing a Form
PrintForm was meant for printing "screenshots" to be filed as documentation, nothing else.
Generally you would choose a low printer resolution (like 100dpi) in order to fill more of the page. This assumed your display(s) were at 96dpi, the old Windows standard.
The method takes fairly complete control so there isn't a lot that can modify the result.
In any case it was never meant as a reporting tool.
-
Oct 23rd, 2020, 06:00 PM
#4
Thread Starter
Fanatic Member
Re: Printing a Form
Problem solved - not very elegant.
I made the form wider. Then I moved all the data to the right. I made a border of about 1.125" on each side. After some ink and paper I got the data centered on the paper.
-
Oct 23rd, 2020, 07:12 PM
#5
Re: [RESOLVED] Printing a Form
Using PrintForm it is not possible to change the position of the printing.
-
Oct 23rd, 2020, 11:44 PM
#6
Re: [RESOLVED] Printing a Form
Also PrintForm can have some misalignment of text in controls (I have noticed), and is fuzzy.
Yell out if you would prefer better solutions.
Rob
PS Long ago I decided to never use printform again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|