得到textbox的大小Rectangle rect = new Rectangle(new Point(0, 0), textbox.Size); StringFormat sf = new StringFormat(); Graphics.DrawString(textbox.Text, pen, brush, rect, sf);
dc.DrawString("你的字符串","定义一个FONT" Brushes.Black, new Rectangle(new Point(10, 40), new Size(50, 1000))); new Rectangle(new Point(10, 40), new Size(50, 1000)) 这里可以指定你需要打印的范围。会自动换行的。
Graphics.MeasureString//计算换行后得到的矩形区域
Graphics.DrawString//打印矩形区域的字符串再看看这个帖子
http://forums.microsoft.com/china/ShowPost.aspx?PostID=3963362&SiteID=15
StringFormat sf = new StringFormat();
Graphics.DrawString(textbox.Text, pen, brush, rect, sf);
new Rectangle(new Point(10, 40), new Size(50, 1000)));
new Rectangle(new Point(10, 40), new Size(50, 1000))
这里可以指定你需要打印的范围。会自动换行的。