Printing content of a RichTextBox

B

Brad Huff

The RichTextBox produces multiple lines if the text from
its Text property is too long. Now I would like to be
able to print that text so that it is multilined like
that shown in the RichTextBox. I tried using a non-
visible RichTextBox in my printing application:

taskdescription.Text = "dkfj dfjoeij
eoijfeoifjdjdifdjdoifjdfoij eoirerijofj eiojfefijf
kdfjdfjoiejrijr jdfd.eoijeroj djfkdoeririoeroe";
for (int j=0;j<taskdescription.Lines.Length;j++){
e.Graphics.DrawString
(taskdescription.Lines[j],
new Font
("Arial",9),Brushes.Black,LEFT_MARGIN+DESCRIPTION_LEFT_MAR
GIN,TOP_MARGIN + TOP_BAND + TOP_DESCRIPTION_HEIGHT +
j*TASK_HEIGHT + i*CELL_HEIGHT);}

It would be appreciated if an alternate way can be
pointed out that works.

Thanks,

Brad
 
H

Herfried K. Wagner [MVP]

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top