|
string text2 = "Draw text in a rectangle by passing a RectF to the DrawString method.";
using (Font font2 = new Font ("Arial", 12, FontStyle.Bold, GraphicsUnit.Point))
{
Rectangle rect2 = new Rectangle (30, 10, 100, 122);
// Specify the text is wrapped.
TextFormatFlags flags = TextFormatFlags.WordBreak;
TextRenderer.DrawText (e.Graphics, text2, font2, rect2, Color.Blue, flags);
e.Graphics.DrawRectangle (Pens.Black, Rectangle.Round (rect2));
} |
|