Results 1 to 1 of 1

Thread: Form Print Component

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Form Print Component

    Article describing how it works on Codeproject

    The attached component is designed to be dropped on a windows form and it extends the controls on that form (i.e. it provides a set of new properties for the control in a manner similar to the way the ErrorProvidor and HelpProvider components do).
    These properties allow you to specify how (and if) you want the control to be printed and then you can call the Print() or PrintPreview() methoids and it will print your form using these properties to do the layout.

    The component provides the following extended properties to all the controls on the form on which the component is sited:
    • BackColour - The colour to fill the bounding rectangle of the control before printing it. If this is transparent then the bounding rectangle will not obscure items printed before it
    • BoundingRectangle - Where on the page to print the component
    • ForeColour - The forewground colour to use to print the control (this has no effect if the print mode is not PrintAsText)
    • HorizontalAlignment, VerticalAlignment - How to align the control's text relative to its bounding rectangle for printing
    • Print - True if it should be printed on the page, false if not
    • PrintFont - The font to use to print the controls text if the print method is PrintAsText
    • PrintMethod - How to print the control
    • TopBorder, BottomBorder, LeftBorder, RightBorder - Pens to use to draw a border around the bounding rectangle on the printed document.
    • Trimming which controls how words wrap within their bounding rectangle
    • PropertyToPrint to allow you to specify which property of the control you want to print


    For rich text box controls there is also the property RichTextBoxPrintMethod whioch specifies whether to print the textbox as plain text or using the rich text box API (for what-you-see-is-what-you-get printing)
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width