は、ここで私は他の人が所与の領域内に収まるテキスト の量を決定するために有用見つけることを願っています方法です:
Public Function GetTextThatFitsLength(_
ByVal e As PrintPageEventArgs, _
Text As String, _
ByVal Width As Integer, _
ByVal Height As Integer, _
ByVal Font As Font, _
Optional ByRef LinesFilled As Integer = 0) As Integer
' returns the number of charaters that fit into the specified area
' optionally returns the number of lines that fit into the area
Dim LayoutArea As New SizeF
With LayoutArea
.Width = Width
.Height = Height
End With
Dim StringFormat As New StringFormat(StringFormat.GenericDefault)
With StringFormat
.Alignment = StringAlignment.Near
.Trimming = StringTrimming.Word
End With
Dim CharactersFitted As Integer
e.Graphics.MeasureString(Text, Font, LayoutArea, StringFormat, CharactersFitted, LinesFilled)
Return CharactersFitted
End Function
そして、これはGDI +(のPrintDocument)ベースの印刷ですか? –