Finding myself unexpectedly released from jury duty for a couple of days I knocked up this desktop only library. I am rather pleased with it (he said modestly). It is compiled for .NET 2.0 but the source is provided and should compile without change under .NET 1.1.
It uses a RichTextBox to provide nicely laid out printed pages with choice of colour, font and alignment. Page setup, preview and print are provided and pagination is automatic. I am still looking to see if manual page breaks can be provided. The printing is based on some code I found in MSDN.
In normal use I envisaged that the RichTextBox would be made invisible and just used to build the document - the example enclosed keeps it visible. If you want to add events use my ControlEvents library and the ControlRef property of the RichTextBoxDesktop.
It is a work in progress and ultimately I will provide a help file. Please try it and post any suggestions for improvement.
EDIT :- Version 1.6 posted with CutSelectionToClipboard and CopySelectionToClipboard methods added. Help file updated.
EDIT :- Version 1.7 posted. Has WordWrap and Scrollbars properties added and a dummy library for the device. Help file updated. Sources for merging posted in separate zip file.
EDIT:- Version 1.8 allows user formatting and editing of text. See post #67.
It uses a RichTextBox to provide nicely laid out printed pages with choice of colour, font and alignment. Page setup, preview and print are provided and pagination is automatic. I am still looking to see if manual page breaks can be provided. The printing is based on some code I found in MSDN.
In normal use I envisaged that the RichTextBox would be made invisible and just used to build the document - the example enclosed keeps it visible. If you want to add events use my ControlEvents library and the ControlRef property of the RichTextBoxDesktop.
It is a work in progress and ultimately I will provide a help file. Please try it and post any suggestions for improvement.
EDIT :- Version 1.6 posted with CutSelectionToClipboard and CopySelectionToClipboard methods added. Help file updated.
EDIT :- Version 1.7 posted. Has WordWrap and Scrollbars properties added and a dummy library for the device. Help file updated. Sources for merging posted in separate zip file.
EDIT:- Version 1.8 allows user formatting and editing of text. See post #67.
Attachments
Last edited: