Monday, March 26, 2007

Printing Documents

There are times when a program needs a printing function. However, the PrintDocument class provided in .NET seems to raw, requiring one to measure of each word in a string, and lay it out on the page. There must be a better way, and after some searches, I found the gem below. How to print the content of a RichTextBox control by using Visual C# .NET or Visual C# 2005 And the Rich Text Format specification With this, Windows will layout the text for you. Say goodbye to MeasureString!

No comments: