Line Wrapping when it should be done

brix_zx2

Member
Joined
Apr 6, 2005
Messages
12
Location
Altus AFB
Programming Experience
1-3
I'm writing a function in my vb.net code to print various fields from a dataview. Everything works well with the exception of line wrapping. I can make a string line wrap but it will just draw at the top of the page and overwrite it self if there is more than one string printed with that command.

With this line I can wrap the text:
ev.Graphics.DrawString(varComments, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, RectangleF.op_Implicit(ev.PageBounds))

This Line I can position it right but no wrap:
ev.Graphics.DrawString(varComments, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, x2, y2)

I want to keep the wrapping but be able to position it, any ideas?
 

Ruffnekk

Member
Joined
Mar 17, 2005
Messages
17
Location
Rotterdam, Netherlands
Programming Experience
10+
You could try to write a function that first chops your long string into multiple lines by inserting vbCrLf or vbNewLine where appropiate and then draw the string including the line breaks.
 
Top Bottom