Visual Basic / Printing / Get DeviceCaps
Snippet details
ID: 422
Viewed: 1394
Added: 2002-08-19
Version:
Get device caps to determine margines
1.Start a new project in Visual Basic. Form1 is created by default.
2.Add two CommandButtons to the Form and paste the following code into the Form's module:
3.Run the project.
4.Click Command1. You will see a message box listing the margins and printable area of the page.
5.Click Command2. Several pages are printed. The printing includes:
Report Header - Only printed at the top of page 1.
Page Header - Consists of some text printed in italics and the current date right-justified on the page. Printed on all pages.
Page Footer - Consists of some text and a page number printed on multiple lines. Printed on all pages.
Additionally, lines numbered 10 through 14 are indented an additional 2 inches and lines numbered 48 through 56 demonstrate enforcing a custom right margin.
1.Start a new project in Visual Basic. Form1 is created by default.
2.Add two CommandButtons to the Form and paste the following code into the Form's module:
3.Run the project.
4.Click Command1. You will see a message box listing the margins and printable area of the page.
5.Click Command2. Several pages are printed. The printing includes:
Report Header - Only printed at the top of page 1.
Page Header - Consists of some text printed in italics and the current date right-justified on the page. Printed on all pages.
Page Footer - Consists of some text and a page number printed on multiple lines. Printed on all pages.
Additionally, lines numbered 10 through 14 are indented an additional 2 inches and lines numbered 48 through 56 demonstrate enforcing a custom right margin.
General Details
Snippet uploaded by: snippet
Email : webmaster@snippetlibrary.com
Snippet By: Unknown
| Snippet By: | Unknown |
| Declarations | |
| Code | |
| Highlight All | |
No Reviews to show
