I want to print the content of my RichTextBox (eintragRichTextBox) I have now this code:
private void druckenPictureBox_Click(object sender, EventArgs e)
{
got it..
on this Place:
if (printDialog.ShowDialog() == DialogResult.OK)
{
StringReader reader = new StringReader(eintragRichTextBox.Text);
documentToPrint.Print();
documentToPrint.PrintPage += new PrintPageEventHandler(DocumentToPrint_PrintPage);
}
I changed to:
if (printDialog.ShowDialog() == DialogResult.OK)
{
StringReader reader = new StringReader(eintragRichTextBox.Text);
documentToPrint.PrintPage += new PrintPageEventHandler(DocumentToPrint_PrintPage);
documentToPrint.Print();
}
Now it works fine..
Also if someone needs to print content of a RichTextBox, you can use my code..