Print a Winform/visual element *

Question

All the articles I've found via google are either obsolete or contradict one another.

What's the easiest way to print a form or, say, a richtextbox in c#? I think it's using the PrintDiaglog class by setting the Document, but how does this get converted?

Answer

At least in VS 2008, its very easy. It took me about a couple of minutes to code the answer after reading your question. Here's where I borrowed it from:

http://msdn.microsoft.com/en-us/library/6he9hz8c.aspx

I tested this, and it works.

< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/5307/" >Print a Winform/visual element< /a>
Share on Google Plus

About Cinema Guy

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment