You are on page 1of 2

How to: Print Client and

Non-Client Areas of a
Form (Visual Basic)
 07/20/2015  2 minutes to read Contributors all

In this article
See Also

The PrintForm component enables you to quickly print an


image of a form exactly as it appears on screen without using a
PrintDocument component. The following procedure shows
how to print a form, including both the client area and the
non-client area. The non-client area includes the title bar,
borders, and scroll bars.

The PowerPack controls are no longer included in Visual


Studio, but you can download them from the Download
Center.

To print both the client and the non-client areas of


a form

1. In the Toolbox, click the Visual Basic PowerPacks tab and


then drag the PrintForm component onto the form.

The PrintForm component is added to the component


tray.

2. In the Properties window, set the PrintAction property to


PrintToPrinter.

3. Add the following code in the appropriate event handler


(for example, in the Click event handler for a Print
Button ).

Copy
PrintForm1.Print(Me,
PowerPacks.Printing.PrintForm.PrintOption.Fu
llWindow)

 Note

On some operating systems, text or graphics drawn


by Graphics methods may not print correctly. In this
case, use the compatible printing method:
PrintForm1.Print(Me,
PowerPacks.Printing.PrintForm.PrintOption.Compatibl

).

See Also
PrintAction
Print
PrintForm Component
How to: Print a Scrollable Form

You might also like