Dear All,
I want to implement printview and printing in my application(it is using RichTextBox.) Can you please guide.
Printable View
Dear All,
I want to implement printview and printing in my application(it is using RichTextBox.) Can you please guide.
Well... I searched for this and got the idea that I should use PrintDialog and PrintDocument controls. I was also able to get some piece of code from web:
printDialog1.Document = printDocument1;
if (this.printDialog1.ShowDialog() == DialogResult.OK)
{
this.printDocument1.DocumentName = this.txtEditor.Text;
this.printDocument1.Print();
}
Problem:
I am not sure what should I use in place of "this.txtEditor.Text". Currently it prints a blank page. I also tried to use the name of RichTextBox control "txtEditor", but same result.
Can anyone guide in this regard?
I ain't to sure if your issue has been resolved but here is a link showing the easy way to printing and print previewing in C# ;)
Code Project - Simple Printing