Answered by:
How to print a Rich Text Box

Question
-
Greetings! I am looking to print the contents of a Rich Text Box. I don't want a Print preview box or a fancy printing code, I just want it to print the Rich Text Box.
Thanks for all of the help!
Wednesday, October 26, 2011 3:28 AM
Answers
-
RTB is the richtextbox in snippet below.
PrintDialog printDlg = newSystem.Windows.Controls.PrintDialog();
if(printDlg.ShowDialog() == true)
{
printDlg.PrintVisual(RTB, "First WPF Print");
}
JP Cowboy Coders Unite!- Marked as answer by Bob Wu-MT Tuesday, November 8, 2011 2:55 AM
Wednesday, October 26, 2011 3:58 AM -
Hi Notapipe,
You can also use the PrintDialog Class and PrintDocument Class in windows forms to do this.
Best Regards,
Bob Wu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Marked as answer by Bob Wu-MT Tuesday, November 8, 2011 2:55 AM
Tuesday, November 1, 2011 2:27 AM
All replies
-
RTB is the richtextbox in snippet below.
PrintDialog printDlg = newSystem.Windows.Controls.PrintDialog();
if(printDlg.ShowDialog() == true)
{
printDlg.PrintVisual(RTB, "First WPF Print");
}
JP Cowboy Coders Unite!- Marked as answer by Bob Wu-MT Tuesday, November 8, 2011 2:55 AM
Wednesday, October 26, 2011 3:58 AM -
Hi Notapipe,
You can also use the PrintDialog Class and PrintDocument Class in windows forms to do this.
Best Regards,
Bob Wu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Marked as answer by Bob Wu-MT Tuesday, November 8, 2011 2:55 AM
Tuesday, November 1, 2011 2:27 AM