snippet library logo
in category
Visual Basic / Printing / Print picture box
Snippet details
ID: 425
Viewed: 1255
Added: 2002-08-19
Version:

User Rated at:
Rate This:
Snippets in this catagory         
Show Printable Version
Example of Using a PictureBox to Print a Form in Any
Orientation

1.Create a new Standard EXE Project. Form1 is created by default.

2.Add two PictureBoxes to Form1 so that each nearly covers the Form.

NOTE: Avoid drawing the second PictureBox within the first. Doing so makes the second PictureBox a member of the first. A simple way to avoid the problem is to place the origin point of the second PictureBox to the left of the origin point of the first PictureBox. Once the second box is drawn, you can resize it so that it is the same size as the first PictureBox.

3.Right-mouse click on Picture2 and choose "Send to Back."

4.Place Picture1 on top of Picture2, covering Picture2.

5.Add a CommandButton and some other controls to Picture1, leaving Picture2 empty.

6.Place this code in the Declarations Section of the module of the Form:

7.Run the Project and click on the "Print Form" button. Note that when you click on Command1, "Print Form", it will print the PictureBox and the controls it contains in Landscape orientation.

General Details
Snippet uploaded by: snippet
Email : webmaster@snippetlibrary.com
Snippet By: Unknown

Snippet By:    Unknown
Declarations
Highlight All
Code
Highlight All




No Reviews to show


Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Subject:

Reviewed By:

Write a review:





Terms of Conditions
Powered By
Avian Hosting
© 2005 snippetlibrary.com All Rights Reserved.