How to Print Entire VB Form and Control the Printed Size (84066)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
- Microsoft Visual Basic Standard Edition for Windows 1.0
This article was previously published under Q84066 SUMMARY
The Visual Basic for Windows PrintForm method provides a way to print
the client area of a form. However, PrintForm does not allow you to
control the size or proportion of the printed output, or to print the
non-client area (the caption and border) of the form.
The following code example uses Windows API functions to print the
entire form, and provides a method to control the size of the output.
This method can also be used to print only the client area to a
specific size and to control the position of the printed form to allow
text or other graphics to be printed on the same page as the image of
the form. The method is also applicable to printing all the forms in a
project.
NOTE: This example will not work correctly on PostScript printers.
For the example to work correctly, the printer must use a standard
non-PostScript laser printer configuration (such as PCL/HP).
REFERENCES
"Microsoft Windows Programmer's Reference Book and Online Resource"
(Add-on kit number 1-55615-413-5)
Modification Type: | Major | Last Reviewed: | 12/12/2003 |
---|
Keywords: | kbcode kbprint KB84066 |
---|
|