Article ID: 230502 - Last Review: July 1, 2004 - Revision: 3.1 How To Print a Form That Is Too Large for the Screen or Page
This article was previously published under Q230502 On This PageSUMMARY
The PrintForm method prints only the portion of the form that is displayed. This article demonstrates how to print a form that is either larger than the screen or is only partially displayed.
MORE INFORMATION
If you need to print a form that is larger than the screen, or is only partially displayed, then the controls on the form must be placed in a PictureBox. This prints the bitmap that is contained in the PictureBox, instead of a screen capture of the form itself (which is what PrintForm does). Because the PictureBox's bitmap is stored in a device context in memory, you have access to the entire bitmap regardless of what is displayed. NOTE: For the purposes of this article, the height of the form is set to 11 inches. If another paper size is desired, such as 8.5- X 14- inches, set the sTall variable to an appropriate value, for example, 14. Also note that these assignments are made in twips because this is the default scalemode for forms. If you change the scalemode, you need to change these values to match as well. Print a Form That Is Larger Than the Screen
Print a Form on More Than One PageIf the form you are printing is too large to fit on a page, you can use the same approach as in the preceding example with a minor addition. The PaintPicture method has a number of optional parameters. The clipping region parameters can be used to grab a portion of the bitmap image and print it.To accomplish this, locate the following code in the previous example: NOTE: Visual Basic 6.0 Online Help states that PrintForm prints the entire form, whether the entire form is visible or not. This information is incorrect. REFERENCESFor additional information about printing forms, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
178076
(http://support.microsoft.com/kb/178076/EN-US/
)
How To Use a PictureBox to Control Orientation Printing a Form
161299
(http://support.microsoft.com/kb/161299/EN-US/
)
How To Capture and Print the Screen, a Form, or Any Window
194580
(http://support.microsoft.com/kb/194580/EN-US/
)
How To Print a Composite Image From a RichTextBox
146022
(http://support.microsoft.com/kb/146022/EN-US/
)
How To Set Up the RichTextBox Control for WYSIWYG Printing
Visual Basic Online Help; search on: "PaintPicture"
APPLIES TO
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
