MCL Print Form Helper component
MCL Print Form Helper component
MCL Print Form Helper component
MCL Print Form Helper component
MCL Print Form Helper component
MCL Print Form Helper component MCL Print Form Helper component MCL Print Form Helper component MCL Print Form Helper component MCL Print Form Helper component MCL Print Form Helper component MCL Print Form Helper component MCL Print Form Helper component
MCL Print Form Helper component MCL Print Form Helper component
MCL Print Form Helper component
Go Back  Xtreme Visual Basic Talk > > > > MCL Print Form Helper component


Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2007, 09:48 AM
Merrion's Avatar
MerrionMCL Print Form Helper component Merrion is offline
Ultimate Contributor

* Guru *
 
Join Date: Sep 2001
Location: Dublin, Ireland
Posts: 1,828
Default MCL Print Form Helper component


One of the most common questions is "how can I print / print preview my form"? This is quite easily done by getting the form to "draw itself" on the printed page but this is often unsatisfactory because:
* The location of components on the form may not be where you want them on the printed page
* Text is drawn at screen resolution
* Every control is drawn (e.g. buttons, the form border etc.)

The attached component addresses the problem in a different manner.
What you do is drop a FormPrintHelperComponent component onto your form an it extends each control with a bunch of new properties (look in the properties window for each control in the section named "MCL Form Print Helper"). You then set these to indicate:
* Whether the control should be printed
* Whether to print it as Text, Image or Owner Drawn
* The boundary rectangle to print it in
* The vertical / horizontal alignment within that area
* Font and background/foreground colour to use etc.

You can then preview the result in design time (the component has a smart tag menu) and preview or print it at run time.

Additionally if you set the print mode for a control to be "owner drawn" the control will raise an event when the form is being printed to allow you to print the form however you feel ...

(This is an early release - I'm going to add the niceties of grid printing and multi-page printing etc. at a later release)
Attached Images
File Type: jpg preview_in_design_mode.JPG (53.7 KB, 145 views)

Last edited by Timbo; 10-12-2007 at 09:30 AM. Reason: Previous attachment removed - full source code is in most recent attachment on this thread
Reply With Quote
  #2  
Old 05-08-2007, 12:13 PM
Merrion's Avatar
MerrionMCL Print Form Helper component Merrion is offline
Ultimate Contributor

* Guru *
 
Join Date: Sep 2001
Location: Dublin, Ireland
Posts: 1,828
Default

New release - now has a PageSetup and PrinterSettings method which brings up the respective dialog boxes to allow the user to view or change the page and priunter settings at run time.

Last edited by Timbo; 10-12-2007 at 09:30 AM. Reason: Previous attachment removed - full source code is in most recent attachment on this thread
Reply With Quote
  #3  
Old 06-13-2007, 12:02 PM
Merrion's Avatar
MerrionMCL Print Form Helper component Merrion is offline
Ultimate Contributor

* Guru *
 
Join Date: Sep 2001
Location: Dublin, Ireland
Posts: 1,828
Default

New release with multi page printing - basically you can decide at design time how many logical pages to turn your form into and then use the extended properties on each control to set which page(s) it prints on.

Options are:
  • Print on every page
  • Print on odd pages
  • print on even pages
  • print on selected pages - whioch in turn has an array of boolean that you set to True for the page you want to print the control on.

Last edited by Timbo; 10-12-2007 at 09:31 AM. Reason: Previous attachment removed - full source code is in most recent attachment on this thread
Reply With Quote
  #4  
Old 06-19-2007, 03:48 PM
Merrion's Avatar
MerrionMCL Print Form Helper component Merrion is offline
Ultimate Contributor

* Guru *
 
Join Date: Sep 2001
Location: Dublin, Ireland
Posts: 1,828
Default

PM with response that might be of interest to others...
Quote:
Hello,

first of all i would like to say that I'm pretty impressed by the program

I have two (probably simple) questions:

1. Is it possible to create multiple pages when there is only one form in the project?

I have a program with only one form but I would like to make a 2 page report from items on the form.

2. How can I put a certain control on a page?
From the website: "print on selected pages - which in turn has an array of boolean that you set to True for the page you want to print the control on."

Where and how to set this?

Thanks in advance,

Jaap.
Yes you can - first you need to set the "LogicalPages" property of the component to 2.

Then select the controls you want printed on just the first page and set the multi page print mode to :
PrintOnSelectedPages and select the PrintOnPages property set the first to true and the second to false - thus the control will only print on page one.

And the converse for the controls you only want on the second page.

Of course any controls you want on all pages you can set to the multi page print mode: PrintOnAllPages

Hope this helps,
Duncan
Reply With Quote
  #5  
Old 10-12-2007, 08:03 AM
Merrion's Avatar
MerrionMCL Print Form Helper component Merrion is offline
Ultimate Contributor

* Guru *
 
Join Date: Sep 2001
Location: Dublin, Ireland
Posts: 1,828
Default

New release - added RichTextBoxPrintMethod which allows you to print a rich text box either (a) as just the text content or (b) using the rich text box API to generate what-you-see-is-what-you-get printing.
Attached Files
File Type: zip MCLFormPrintControl_src.zip (245.8 KB, 227 views)

Last edited by Merrion; 10-12-2007 at 08:21 AM. Reason: eep - wrong attachment
Reply With Quote
  #6  
Old 05-07-2008, 03:04 AM
Merrion's Avatar
MerrionMCL Print Form Helper component Merrion is offline
Ultimate Contributor

* Guru *
 
Join Date: Sep 2001
Location: Dublin, Ireland
Posts: 1,828
Default

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
MCL Print Form Helper component
MCL Print Form Helper component
MCL Print Form Helper component MCL Print Form Helper component
MCL Print Form Helper component
MCL Print Form Helper component
MCL Print Form Helper component MCL Print Form Helper component MCL Print Form Helper component MCL Print Form Helper component MCL Print Form Helper component MCL Print Form Helper component MCL Print Form Helper component
MCL Print Form Helper component
MCL Print Form Helper component
 
MCL Print Form Helper component
MCL Print Form Helper component
 
-->