A small library to print a Windows Forms TreeView Control
I looked and looked for a sample code to print TreeView controls in C#. I couldn't find anything that did exactly what I needed, so I broke down and wrote it myself!
During my search for a printing sample, I came across this article by Koay Kah Hoe, which presents a solution in C++. It gave me a few ideas and after finding some information on Usenet about getting an image of a control, I was ready to code.
The PrintUtility class should be fairly easy to use from just about any Windows Forms application. Just call either PrintTree or PrintPreviewTree, passing in your TreeView.
This code was originally published as part of an article on CodeProject.com.