Wrapping Unformated Text

GrexD

Well-known member
Joined
Mar 5, 2008
Messages
95
Programming Experience
Beginner
I'm pulling free form text out of a database memo field and putting it in a textbox. Sometimes this text will need to be printed. The text has line breaks in it only for paragraphs. When it is displayed in the textbox it wraps the text as you would expect. Everything looks fine. However, when I go to print it I loose the line wrapping.

What is the best way to handle this? Is there some formatting that can be done with the PrintDocument or is there a member of the string class that can help with this?

I wrote a routine that would put in line wrapping before it is put in the textbox, but it is only so good. It seems there should be a better way to do this but I'm unfamiliar with the PrintDocument and the .net string class.
 
Graphics.DrawString method does this if you use the one that specifies a bounding Rectangle instead of just a Point.
 
Back
Top