شوف ينفع هذا التعديل لنفس الكود الأخير في جز الحدث PrintDocument1_PrintPage
لأن الطلب الأخير محتاج وقت
PHP كود :
Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim leftMargin As Integer = e.MarginBounds.Left
Dim topMargin As Integer = e.MarginBounds.Top
Dim cellFont As New Font("Arial", 14)
Dim cellForeColor As New SolidBrush(Color.Black)
Dim cellBackColor As New SolidBrush(Color.WhiteSmoke)
Dim cellBorderColor As New Pen(Brushes.Blue, 1)
Dim cellSize As New Size(300, 100)
Dim y As Integer = 0
For index = 0 To products.Count - 1
Dim cellText As String =
"confirming QSO with " & products.Keys(index) & vbNewLine & _
products(products.Keys(index))
Dim txtSize As Size = TextRenderer.MeasureText(cellText, cellFont)
Dim cellPoint As New Point(leftMargin + (0), topMargin + (y))
Dim cellRectangle As New Rectangle(cellPoint, New Size(cellSize.Width, txtSize.Height))
e.Graphics.FillRectangle(cellBackColor, cellRectangle)
e.Graphics.DrawString(cellText.Trim, cellFont, cellForeColor, cellRectangle)
e.Graphics.DrawRectangle(cellBorderColor, cellRectangle)
y += txtSize.Height
Next
End Sub
لأن الطلب الأخير محتاج وقت

