drawstring with line wrapping?

  • Thread starter Thread starter Danie
  • Start date Start date
D

Danie

I need to use drawstring, but it always draws one line, and I need to divide
it. to give it a specified width which it doesnt cross, but starts another
line.
is it possible?

thanks
daniel
 
DrawString is overloaded to allow a StringFormat to be used with it. Play
with that.
 
Danie said:
I need to use drawstring, but it always draws one line, and I need to divide
it. to give it a specified width which it doesnt cross, but starts another
line. is it possible?

\\\
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
e.Graphics.DrawString("Hello World Hello World Hello World", Me.Font, Brushes.Red, New RectangleF(0, 0, 40, 200))
End Sub
///
 
thanks
Herfried K. Wagner said:
\\\
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
e.Graphics.DrawString("Hello World Hello World Hello World", Me.Font,
Brushes.Red, New RectangleF(0, 0, 40, 200))
 
Back
Top