How it works

The component implements System.ComponentModel.IExtenderProvider which means that it extends each of the controls on the form to add a bunch of extra properties to that control. Then when the Print or Print Preview component methods are called it uses these extended properties to lay out and print the form.

There are also component properties that control how the control prints or previews the form, and also the name of the document in the spool queue.

Getting started

  • First you need to download the source and compile it to a release dll. (Or download the .dll itself if you prefer)
  • Then open the windows forms project to which you want to add form printing capabilities.
  • Right click on the Toolbox and select the menu item "Choose Items"
  • In the resulting dialog box press Browse and select the MCL Form Print Control
Adding the component to the toolbox
  • Press OK and the component will be added to your toolbox
Toolbox with the MCL Form Print Component installed
  • Open the form that you want to add printing to in the designer
  • Drag the component from the toolbox onto the designer
  • Select the component and set the document properties
Setting document properties
  • Click on the component task link
Component task menu
  • Click the task "Print Preview". It should bring up an empty print preview document.
  • Select each control (text box, label etc) on your form that you are going to want to print. In the properties of the control there will be a set of extended properties that have been added by the MCL Form Print Component:
Extended control properties
  • Set the property Print on FormPrintComponent1 to true.
  • Set the property Bounding rectangle to the rectangle area on the printed page where you want the control to print
  • Set a border or background colour and select the component task "Preview" again to see where it is positioned
Previewing the layout

Worked examples

The following examples are a guide to using the various properties of the control - please feel free to add any other examples you have todo

FAQ and Troubleshooting

If something isn't working as you expect have a look in the FAQ page - if there's no answer there then maybe add an issue to the issue tracker.

Last edited May 21, 2014 at 12:15 PM by Merrion, version 5

Comments

No comments yet.