2009-04-25 73 views

回答

5

http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=286

您可以通過傳遞的RectangleF對象拉繩方法繪製一個矩形文本。 GDI +將包裝文本以使其適合指定的矩形。例如:

Dim s As String = "This string will be wrapped in the output rectangle" 
Dim rectf As New RectangleF(10, 100, 200, 200) 
grf.DrawString(s, myFont, Brushes.Red, rectf) 
3

如果你提供一個矩形的Graphics.DrawString方法的重載,它會包裹在矩形內的文本。

Overloads Public Sub DrawString(String, Font, Brush, RectangleF)